數組、鏈表、跳表
sequenceDiagram
participant ArrayList
participant LinkedList
Note right of ArrayList: prepend O(1)<br/>append O(1)
Note left of ArrayList: lookup O(1)<br/>insert O(n)<br/>delete O(n)
Note right of LinkedList: lookup O(n)<br/>insert O(1)<br/>delete O(1)
跳表(1989):Skip List
- 平衡樹(AVL Tree)和二分查找
- 插入(Insert)/刪除(Delete)/搜索(Search) O(log n)
- 原理簡單、容易實現、方便擴展、效率更高
- Redis和LevelDB
LRU Cache
Skip List
Choose Concurrency-Friendly Data Structures