Guest User

Untitled

a guest
Jan 23rd, 2020
3,526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. IF sorted THEN (binary search OR two pointer)
  2. IF all permutations/subsets THEN backtracking
  3. IF tree THEN (recursion OR two pointer OR obvious recursion below)
  4. IF graph THEN dfs/bfs
  5. IF linkedlist o(1) space THEN two pointer
  6. IF obvious recursion problem but recursion banned THEN stack
  7. IF options (+1 or +2) THEN DP
  8. IF k items THEN heap
  9. IF common strings THEN (map OR trie)
  10. ELSE (map/set for O(n) time O(n) space or sort for O(n lg n) time O(1) space)
  11.  
  12.  
  13. https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
  14. https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
  15. https://leetcode.com/problems/binary-search-tree-iterator/
  16. https://leetcode.com/problems/find-duplicate-subtrees/
  17. https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
  18. https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
  19. https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
  20. https://leetcode.com/problems/decode-string/description/
  21. https://leetcode.com/problems/heaters/description/
  22. https://leetcode.com/problems/find-k-closest-elements/
  23. https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
  24. https://leetcode.com/problems/k-diff-pairs-in-an-array/
  25. https://leetcode.com/problems/palindrome-linked-list/
  26. https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
  27. https://leetcode.com/problems/longest-substring-without-repeating-characters
  28. https://leetcode.com/problems/beautiful-arrangement/
  29. https://leetcode.com/problems/utf-8-validation/discuss/87485/O(n)-JAVA-solution-with-detailed-explaination
  30. https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ Iterative *
  31. https://leetcode.com/problems/word-ladder/description/
  32. https://leetcode.com/problems/redundant-connection/
  33. https://leetcode.com/problems/house-robber/
  34. https://leetcode.com/problems/decode-ways/description/
  35. https://leetcode.com/problems/target-sum
  36. https://leetcode.com/problems/word-break/
  37. https://leetcode.com/problems/maximum-length-of-pair-chain
  38. https://leetcode.com/problems/combination-sum-iv/
  39. https://leetcode.com/problems/contains-duplicate-iii/description/
Advertisement
Add Comment
Please, Sign In to add comment