Data Structure
Last updated
Last updated
hash table / hash map / hash set
heap / priority heap / min heap / max heap
Union Find
queue interface: LinkedList, PriorityQueue, Deque(doulbe queue)
Trie (inset/find/startswith)
Binary Indexed Tree / Fenwick Tree
time complexity O(keyLength), not O(1), because need to calculate hash value
Hash function Magic Number: 31, prime number
Rehash size / capacity > 10%, need to rehash
Open Hashing vs Closed Hashing
Open Hashing, LinkedList
deficiency: LinkedList slower than Array https://www.cs.usfca.edu/~galles/visualization/OpenHash.html
Closed Hashing, Array
deficiency: when item deleted, occupy position, affect find time. https://www.cs.usfca.edu/~galles/visualization/ClosedHash.html
http://www.jiuzhang.com/solutions/lru-cache/