Professional Documents
Culture Documents
Cheat Sheet
Arrays & Strings →
Time Complexity
Bonus
StringBuilder.append (char||String)
Stack/Queue/Deque →
Implementation:
DFS vs BFS
DFS BFS
to Source Source
Recursiv Slow
Fast
Approach:
before
the current state, then add value for the current state.
Formula:
[i-k]) + cost[i]
the current state, then add value for the current state.
Formula:
Find all optimal solutions for every interval and return the best
possible answer
Formula:
DP on Strings
Approach:
Formula:
Bit Manipulation →
0 & 1 -> 0
1 ^ 1 -> 0
1 & 1 -> 1
INVERT ~ 0 -> 1
OR 0 | 0 -> 0
~ 1 -> 0
0 | 1 -> 1
Bonus:
1 | 1 -> 1 Shifting
- Left Shift
Quick Sort
Insertion sort
Binary Search Iterative
Binary Search Iterative
Subset backtrack pattern
Subset backtrack pattern
palindrome backtrack pattern
permutation backtrack pattern