Implement LRU algorithm; Write code to implement a general Binary Search Tree
Respuestas de entrevistas
Anónimo
24 sept 2010
a few details about the above post:
the linked list should be doubly linked, so that remove is not O(n)
the id should be some sort of hash of the page
1
Anónimo
12 ene 2010
LRU:
Hashtable is used to hold pages IDs as keys and pointers to the appropriate page.
All the pages are in a linked list.
Anytime we access some page, it is placed at the head of the list. This way pages to be removed are always at the tail of the list. Each page should know its ID, so that we could remove it also from the hashtable.