leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

LRU Cache: Not necessary to update cacheMap after splice

Open nblintao opened this issue 9 years ago • 0 comments

In LRU Cache, after moving a node in the list to the front, it updated cacheMap[key] to cacheList.begin().

But I don't think the iterator to the node will be changed after splicing.

nblintao avatar Oct 03 '16 16:10 nblintao