- https://leetcode.com/lag945/
- Problems Solved
- 2021.10.06: 0024
- 2021.11.03: 0100
- 2021.12.05: 0173
- 2021.12.24: 0200
- What a season challenge journey! To be continued.
- 2022.04.28: 0300
- 2022.11.28: 0400
- Rabin-Karp algorithm: Pattern Searching/Matching
- Monotonic Stack
- Topological sort
- Spell checker(trie/prefix tree)
- Priority queue(time complexity = sort = nlog(n))
- Binary tree Traversal,preodrer=first node is root,inorder=split left right by root,postorder=last node is root
- Graph - Union Find/Disjoint Set Union (DSU)
- C# use BitArray class
- BitArray ba = new BitArray(BitConverter.GetBytes(int32));
- Hamming distance
- XOR
- A XOR B writes A ^ B (C#)
- A XOR B XOR A = B
- Count
- Count 1: (1) while(n>0){n = n&(n-1);count++;} (2) for(int i=0;i<32;i++){ n&1==1?count++:; n = n >>1; } (3) foreach( bool b in bitarray) if(b) count++;
- Count 0: (1) 32-(Count 1) (2) foreach( bool b in bitarray) if(!b) count++;
- Reverse singly linked list (T=O(n),S=O(1))
- https://leetcode.com/problems/queries-on-number-of-points-inside-a-circle/
- https://leetcode.com/problems/interval-list-intersections/
- https://leetcode.com/problems/merge-intervals/
- https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/
- (Quick-SELECT)[https://leetcode.com/problems/k-closest-points-to-origin/]
- (Sort)[https://leetcode.com/problems/remove-covered-intervals/]
- Best Path
- Mutex
- Thread synchronization I
- Thread synchronization II - sequence
- Deadlock - Dining philosophers problem
- Attentiveness test(Hard to pass once)