Completed LeetCode problem #146 - LRU Cache


https://leetcode.com/problems/lru-cache/description/

Using Doubly linked List, hmm, improving the performance is a challenge.

UPDATE. by putting the ListItem into the Dictionary as entry, avoided the need of looking for the listitem each time, improved the performance by 50%(from 600ms to 300ms), and from bottom 20% to top 10%.

Comments

Popular posts from this blog

Completed the LeetCode #2 adding two numbers