Funky Big-O complexities
reference
Some of the funkier Big-O complexities that might not be immediately clear during the heat of an interview:
- Generate all subsequences: $O(2^N)$
- Generate all subarrays of 1D array: $O(N^2)$
- Generate all subarrays of 2D array: $O({(MN)}^2)$
Links to this note
Common techniques for coding problems
Sliding window Two/three-pointer Recursion, DFS, BFS, DP Interval problems (insert, merge) Linked lists (reverse, find dups, etc.) Prefix sum Binary search Bit manipulation (sum of 2 integers, is power of...