Basics
3 lessons · Big-O · I/O · type complexity
01. Time Complexity
Big-O · Execution time · Memory limits
Most Baekjoon problems have time and memory limits, so inefficient algorithms simply don't pass. Learn Big-O before writing code so you can predict whether your approach will fit within the constraints.
02. Fast I/O in Python
sys.stdin.readline · sys.stdout.write · EOF
input() and print() are slow enough to cause TLE on their own when N is large. Master the idioms for fast I/O — sys.stdin.readline for reading, sys.stdout.write or '\n'.join() for writing.
03. Time Complexity of Built-in Types
list · deque · set · dict per-operation cost
Picking the right container is often the difference between AC and TLE. Learn the average-case time complexity of every common operation on list, deque, set, and dict.
Core Data Structures
5 lessons · arrays · stacks/queues · hash · heap · linked list
04. Arrays & Strings
Slicing · string methods · ASCII tricks
Arrays and strings are the foundation for two-pointer, palindrome, and anagram problems. Master slicing, the string methods you'll use every day, and ASCII-based tricks.
05. Stacks & Queues
list vs deque · brackets · postfix
LIFO and FIFO are the building blocks for bracket matching, postfix evaluation, and sliding window problems. Learn when to use list and when to switch to deque.
06. Hashing — dict, set, Counter
O(1) membership · frequency counting · dedup
Hash maps and sets give you O(1) average-case lookups. They turn many O(n²) brute-force problems into one-pass solutions. Master dict, set, defaultdict, and Counter.
07. Heap & Priority Queue
heapq · min/max heap · Top-K
A priority queue answers 'what's the smallest (or largest) element right now?' in O(log n). It's the engine behind Dijkstra, Top-K, and stream-median problems.
08. Linked Lists
singly · doubly · circular — built by hand
Pointer-based structures are rarely the right answer in Python (a list does everything faster), but implementing them once cements your understanding of nodes and references.
Sorting & Searching
4 lessons · sort algorithms · binary search · parametric search
09. Sorting Algorithms
Bubble · Insertion · Merge · Quick
Implement the classic sorts by hand to internalize time complexity, stability, and in-place properties — knowledge that lets you reason about Python's sorted() in any context.
10. Python Sorting in Practice
sorted/sort · key · multi-key · stability
Master Python's built-in sort: in-place vs new list, multi-key sorting, reverse, custom key functions, and exploiting the stability guarantee.
11. Binary Search
Hand-coded + bisect · lower/upper bound
Binary search reduces O(n) to O(log n) on sorted data. Master the recurrence by hand so you can apply it to non-trivial 'find the boundary' problems.
12. Parametric Search
Decision problem · 'maximum X that still works'
Parametric search turns 'find the optimal X' into 'is X feasible?' and binary-searches on the answer. It's the #1 trick for Gold-tier optimization problems.
Graphs (Basic)
4 lessons · representation · DFS · BFS · topological sort
13. Graph Representation
Adjacency list / matrix · directed / weighted
Choose the right graph representation based on density and required operations. Master the standard idioms for reading graph input from BOJ-style problems.
14. DFS — Depth-First Search
Recursive · explicit stack · connected components
DFS explores as far as possible along each branch before backtracking. It's the workhorse for connected components, tree traversal, and many backtracking problems.
15. BFS — Breadth-First Search
deque · shortest distance · grid
BFS explores level by level — perfect for shortest path in unweighted graphs. Use a deque, mark visited on enqueue (not dequeue), and you've got the canonical pattern.
16. Topological Sort
Kahn (BFS) · DFS-based · DAGs
Order tasks with prerequisites. Kahn's algorithm uses BFS and in-degrees; the DFS-based version produces a reverse post-order. Both detect cycles as a bonus.
Trees
3 lessons · traversal · BST · Trie
17. Tree Traversal
Pre / In / Post-order · Level-order · recursive vs iterative
Four canonical traversals of binary trees: preorder, inorder, postorder, and level-order. Master both the recursive and iterative versions.
18. Binary Search Tree
Insert · Search · Delete · balance
BSTs give O(log n) search/insert/delete if balanced — but degenerate to O(n) if not. Understand why balance matters and how production libraries (TreeMap, set) maintain it.
19. Trie
String search · autocomplete · prefix
A trie stores a set of strings as a tree where each path from the root spells a string. It gives O(L) lookup independent of N — perfect for autocomplete and prefix queries.
DP & Greedy
4 lessons · DP basics · advanced DP · greedy · divide & conquer
20. Dynamic Programming — Basics
Memoization · Tabulation · Fibonacci · stairs
DP turns exponential brute force into polynomial-time solutions by storing answers to subproblems. Learn the two flavors (top-down memoization vs bottom-up tabulation) on classic problems.
21. Advanced DP
LCS · LIS · 0/1 Knapsack · matrix chain
The four DP patterns you must memorize: longest common subsequence, longest increasing subsequence, 0/1 knapsack, and matrix chain multiplication.
22. Greedy
Meeting room · coin · activity selection
Greedy algorithms pick the locally optimal choice at each step. Their power and danger is that this isn't always globally optimal — you must prove (or strongly believe) the greedy choice is correct.
23. Divide & Conquer
Merge · Quick · Fast exponentiation · CCW
Divide & conquer splits a problem into independent sub-problems, solves each, and combines. Master matrix power, CCW (cross product), and fast exponentiation.
Graphs (Advanced)
3 lessons · Dijkstra · Floyd-Warshall · MST
24. Dijkstra's Algorithm
Priority queue · no negative weights
Single-source shortest path in a graph with non-negative weights. The heapq-based implementation is the de facto standard for competitive programming.
25. Floyd-Warshall
All-pairs shortest path · DP view
Compute shortest paths between every pair of nodes in O(V³). Easy to code (3 nested loops) and handles negative weights — though not negative cycles.
26. Minimum Spanning Tree
Kruskal + Union-Find · Prim
Find the minimum-weight tree that connects all vertices. Kruskal sorts edges then greedily adds non-cycle-forming ones via Union-Find; Prim grows the tree by always adding the cheapest border edge.
Applied Patterns
1 lesson · two pointers · sliding window · bitmask · prefix sum