Click here to Skip to main content
15,891,656 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
To sum it up, I'm stuck trying to figure out how to implement a sample OPT cache replacement policy algorithm.

Its based on look ahead, I just can't figure out how to implement it in code.

I'm supposed to remove the item that will be called the farthest away from the currently called item.

Ideas?

TIA

[edit]
This had been previously posted in the C++ forum and then this morning I realized it was in the wrong place. My apologies. I have removed the original posting so as not to double post.

Posted

1 solution

Something in this[^] list might help. One thought would be to implement a BST as a base for this.

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900