Topics
Time and space complexity (Big-O)
Estimate how running time grows with input size.
Arrays and vectors
Use arrays/vectors and know cost of access, insert, delete.
Two pointers
Solve pair and reverse problems with two moving indices.
Sliding window
Reuse previous work for subarray/substring problems.
Kadane's algorithm (max subarray)
Find maximum subarray sum in O(n).
Binary search
Halve the search space each step on sorted data.
Bubble, selection and insertion sort
Understand simple sorts and their O(n^2) cost.
Merge sort
Divide, sort halves, and merge in O(n log n).
Quick sort
Partition around a pivot and recurse.
Hashing and hash maps
Use unordered_map/set for O(1) lookup and counting.
String problems
Solve palindrome, anagram and frequency problems.
Recursion and the call stack
Think recursively and trace the stack.
Backtracking
Explore choices and undo them (subsets, permutations, N-Queens).
Linked lists
Create, insert, delete and traverse singly linked lists.
Linked list problems: reverse, middle, cycle
Use pointer tricks: reverse in place, slow/fast pointers.
Stacks
Use LIFO for undo, parentheses and expression evaluation.
Queues and deques
Use FIFO queues and double-ended queues.
Monotonic stack: next greater element
Solve 'next greater/smaller' problems in O(n).
Binary trees and traversals
Build trees and do inorder, preorder, postorder, level order.
Binary search trees
Insert, search and delete in a BST.
Heaps and priority queues
Always get the min/max quickly; top-k problems.
Graphs and BFS
Represent graphs and explore level by level.
DFS, connected components and cycles
Explore deep first; count islands; detect cycles.
Shortest paths: Dijkstra
Find cheapest paths with weights.
Dynamic programming
Store answers to subproblems: memoization and tabulation.