Re: [algogeeks] lru cache

2010-07-03 Thread Abhirup Ghosh
I think this can be implemented with queue data structure. Whenever an element is used, remove it from the queue use it and then again insert it in the queue at the back. So the front element in the queue is the least recently used one. -Abhirup On Fri, Jul 2, 2010 at 10:23 PM, jaladhi dave wro

Re: [algogeeks] lru cache

2010-07-02 Thread jaladhi dave
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

[algogeeks] lru cache

2010-07-02 Thread sharad kumar
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 algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more o