« Software Campfire Stories: The Beauty And The Bug | Main | JDK Source Browsing: Interesting Way To Format An Array To String »



Feed You can follow this conversation by subscribing to the comment feed for this post.

Ganesh Kumar

It is a nice and simple way to implement LRUCache. But I did not understand why we need to pass capacity+1 to the super constructor.


I have implemented LRU here http://www.gohired.in/2014/08/implement-lru-cache.html


Wonderful explanation!!!


I was asked to write similar program (like above)in an interview.This is what i was looking for.Thanks.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)