Question d’entretien chez LinkedIn

Design LRU Cache

Réponses aux questions d'entretien

Utilisateur anonyme

2 avr. 2013

Use a priority queue. It can be reordered in terms of time accessed.

1

Utilisateur anonyme

7 juin 2011

I tried to come out with a complicated solution, but they wanted the simplest one. A Hashmap and doubly linked list should satisfy them. Keep putting the recently accessed node on top of the queue and while inserting a new element, if its full, remove the last node in the queue.

Utilisateur anonyme

23 févr. 2012

why not use a minHeap?