Two versions of LRUCache, one's time complexity is O(n), the other's is
O(1).