Posts

Completed LeetCode problem #460 - LFU Cache

https://leetcode.com/problems/lfu-cache/description/ for the items with the same used frequency, the most recently used stay in the front. used sequential method to locate the new position for an item so as to improve performance, the recursive method just sucked in performance!!!.

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%.

Completed LeetCode problem #12-Integer to Roman

https://leetcode.com/problems/integer-to-roman/description/ Used Switch statement and pay attention to details

Completed LeetCode problem #13 - Roman to Integer

https://leetcode.com/problems/roman-to-integer/description/

Completed Leetcode problem #92 - Reverse Linked List II

https://leetcode.com/problems/reverse-linked-list-ii/description/

Completed LeetCode problem #206 - Reverse Linked List

https://leetcode.com/problems/reverse-linked-list/description/