新发现一种类型的题目,list (doubly linked list ) + map/unordered_map,实现O(1)

list 的插入删除是O(1)
map排序是O(logN)
hashMap 查找是O(1)
题目有
All O`one Data Structure
Insert, Delete, getRandom in O(1) w/o duplicate
LRU cache
LFU cache
max stack

Comments

Popular posts from this blog

1427. Split Array into Fibonacci Sequence

Amazon OA 763. Partition Labels

05/25 周一