Week 1 β Introduction & Kattis Setup
- π₯ Video lectures:
- π§© Example problem: Airfare Grants (Solution)
- π Additional Resources: Intro slides, Common Kattis Input Patterns
- π Problem set:
- Tip: Go to kattis.com and sort problems by difficulty. Do as many problems as you can in ascending order.
Week 2 β Two Pointer Technique
- π₯ Mini-lecture: Two Pointer Technique used in mergesort and the two sum problem
- π§© Example problem: Merge Sorted Array (Solution)
- π Additional Resources: Two Pointer Slides
- π Problem set:
- Tip: For more practice, go to leetcode's official list of Two Pointer problems to practice more problems.
Week 3 β Stacks and Queues
- π₯ Mini-lecture: Stacks and Queues
- π§© Example problem: Bracket Matching (Solution)
- π§© Example problem: Eeny Meeny (Solution)
- π Additional Resources: Stacks and Queues Slides
- π Problem set:
Week 4 β Sliding Window
- π₯ Mini-lecture: Sliding Window Technique
- π§© Example problem: Maximum Average Subarray (Solution)
- π Additional Resources: Sliding Window Slides
- π Problem set:
Week 5 β Binary Search and BinaryTrees and Traversals
- π₯ Mini-lecture:
- π§© Example problem: Guess the Number (Solution)
- π Additional Resources: Binary search and binary trees
- π Problem set:
Week 6 β Dynamic Programming I (1D Arrays)
- π₯ Mini-lecture: DP - coin row and Kadane's algorithm
- π§© Example problem: House Robber (Solution)
- π Slides: Dynamic Programming
- π Problem set (Leetcode):
Week 7 β Dynamic Programming II (2D Arrays)
Topic: DP on grids, 2D states, and table-filling patterns.
- π₯ Mini-lecture: 2D DP tables and transition rules
- π§© Example problem: Number of paths in a grid with obstacles
- π **Problem set (Kattis):_
- Grid path counting or min-cost path
- Small 2D DP (e.g., edit distanceβstyle problem)
Goals:
- Design a 2D DP state (what does
dp[i][j]mean?). - Handle boundaries and base cases carefully.
- Understand memory and time tradeoffs of 2D DP.
Week 8 β Graphs I (BFS & DFS)
Topic: Core graph algorithms and representations.
- π₯ Mini-lecture: Adjacency lists, BFS, and DFS
- π§© Example problem: Connected components or simple reachability
- π **Problem set (Kattis):_
- BFS on an unweighted graph
- DFS for counting components or detecting cycles
Goals:
- Build adjacency lists from input (directed and undirected).
- Choose BFS vs. DFS appropriately.
- Understand how to mark visited nodes and avoid infinite loops.
Week 9 β Graphs II (Shortest Paths & More)
Topic: Weighted graphs and classic shortest path techniques.
- π₯ Mini-lecture: Dijkstraβs algorithm and common shortest path patterns
- π§© Example problem: Shortest path on a weighted graph
- π **Problem set (Kattis):_
- Dijkstra on a small to medium graph
- Another graph problem combining ideas from earlier weeks
Goals:
- Recognize when a problem is really a shortest path problem.
- Implement Dijkstra with a priority queue.
- Combine graph insights with earlier techniques (DP, greedy, etc.).