Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF sorted THEN (binary search OR two pointer)
- IF all permutations/subsets THEN backtracking
- IF tree THEN (recursion OR two pointer OR obvious recursion below)
- IF graph THEN dfs/bfs
- IF linkedlist o(1) space THEN two pointer
- IF obvious recursion problem but recursion banned THEN stack
- IF options (+1 or +2) THEN DP
- IF k items THEN heap
- IF common strings THEN (map OR trie)
- ELSE (map/set for O(n) time O(n) space or sort for O(n lg n) time O(1) space)
- https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
- https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
- https://leetcode.com/problems/binary-search-tree-iterator/
- https://leetcode.com/problems/find-duplicate-subtrees/
- https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
- https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
- https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
- https://leetcode.com/problems/decode-string/description/
- https://leetcode.com/problems/heaters/description/
- https://leetcode.com/problems/find-k-closest-elements/
- https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
- https://leetcode.com/problems/k-diff-pairs-in-an-array/
- https://leetcode.com/problems/palindrome-linked-list/
- https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
- https://leetcode.com/problems/longest-substring-without-repeating-characters
- https://leetcode.com/problems/beautiful-arrangement/
- https://leetcode.com/problems/utf-8-validation/discuss/87485/O(n)-JAVA-solution-with-detailed-explaination
- https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ Iterative *
- https://leetcode.com/problems/word-ladder/description/
- https://leetcode.com/problems/redundant-connection/
- https://leetcode.com/problems/house-robber/
- https://leetcode.com/problems/decode-ways/description/
- https://leetcode.com/problems/target-sum
- https://leetcode.com/problems/word-break/
- https://leetcode.com/problems/maximum-length-of-pair-chain
- https://leetcode.com/problems/combination-sum-iv/
- https://leetcode.com/problems/contains-duplicate-iii/description/
Advertisement
Add Comment
Please, Sign In to add comment