davidoh
IPA - /ˈdeɪvɪd oʊ/
davidoh2018 [at] gmail [dot] com
- If input array is sorted:
- Binary Search
- Two Pointers
- If given a tree:
- If asked for all permutations/subsets:
- If given a graph:
- If given a linked list:
- If Recursion is banned:
- If asked for max/min subarray/subsets/options:
- If asked for top/least K ITEMS:
- If asked for common strings:
- If need to keep count of distinct elements:
- Else:
- Map/Set for O(1) time & O(n) space
- Sort input for O(nLogn) time and O(1) space
Back to main