keep n bits (depending on the usage level you want) to track for each element (cell/page) etc in the cache.
Now whenever an element is loaded into cache set all the bits and on further use increment by 1 if not max value. Decrement value by 1 for all the block periodically. Now whenever you need to remove an element, select one with least value. On Fri, Jul 2, 2010 at 6:59 PM, sharad kumar <[email protected]>wrote: > how would u implement LRU cache > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
