COMP 220 — Code Downloads
All homework and lab starter code, plus practice problem starter/solution code, one zip per item. Click a unit to expand it. Download a zip, unzip it, and open it in the IDE of your choice (VS Code, Programiz, etc.). No account or login is needed.
Week 1 — Units 1 & 2, HW 1
Unit 1 — HW 1
📝 HW 1 - Analyzing My Sort
- Starter code
Starter
Week 2 — Units 3 & 4
Unit 3 — Practice Problems, Lab
🔧 Practice problems
- Practice 2: Implement Bubble Sort Optimization #1
StarterSolution - Practice 3: Practice 3: Implement Bubble Sort Optimization #1 Copy
StarterSolution - Practice 4: Implement Descending Insertion Sort
StarterSolution - Practice 6: Implement Descending Insertion Sort
StarterSolution
🧪 Lab 03: Write a mySortThree() function
- Starter code
Starter
Week 3 — Units 5 & 6, HW 2
Unit 5 — Practice Problems, Lab, HW 2
Unit 6 — Lab
🧪 Lab 06: Recursive Differences
- Starter code
Starter
Week 4 — Units 7 & 8
Unit 7 — Practice Problems, Lab
🔧 Practice problems
- Practice 1: Practice 1: Finish printStack() method in class stackArray
StarterSolution - Practice 2: Practice 2: Finish resize() method in class stackArray
StarterSolution - Practice 3: Practice 3: Finish printStack() method in class stackLinkedList
StarterSolution
🧪 Lab 07: Reversing an array using a Stack
- Starter code
Starter
Unit 8 — Practice Problems, Lab
Week 5 — Units 9 & 10, HW 3
Week 6 — Units 11 & 12
Unit 11 — Practice Problems, Lab
🔧 Practice problems
- Practice 1: Practice 1: Observe printGeeks() function Legend
Starter - Practice 2: Practice 2: Finish depth-First printTree() function
StarterSolution - Practice 3: Practice 3: Implement a “PRE-Order” traversal in printTree()
StarterSolution - Practice 4: Practice 4: Insert - always left, (or always Right) in printTree()
StarterSolution
🧪 Lab 11: Is Valid Binary Search Tree
- Starter code
Starter
Unit 12 — Practice Problems
🔧 Practice problems
- Practice 3: Practice 3: Implement a sorted insert() function for a BST
StarterSolution - Practice 5: Practice 5: Implement a find_brute_force() function for a BST
StarterSolution - Practice 6: Practice 6: Implement a find_optimal() function for a BST
StarterSolution - Practice 7: Practice 7: Implement a get_min_node() function for a BST
StarterSolution - Practice 8: Practice 8: Implement a get_size() function for a BST
StarterSolution
Week 7 — Units 13 & 14, HW 4
Week 8 — Units 15 & 16
Week 9 — Units 17 & 18, HW 5
Unit 17 — Practice Problems, Lab, HW 5
📝 HW 5 - Symbol Table via Hash Tables with Separate Chaining
- Starter code
Starter
🔧 Practice problems
- Practice 1: Practice 1: Double Linked List, Insert Key:Value Pair
StarterSolution - Practice 2: Practice 2: Double Linked List, Delete Key:Value Pair
StarterSolution - Practice 3: Practice 3: Double Linked List, Get Value from Key
StarterSolution - Practice 4: Practice 4: Binary Search Array: Find Key Position
Starter
🧪 Lab 17: Implement the SymbolTable containsKey( ) method
- Starter code
Starter
Unit 18 — Practice Problems, Lab
🔧 Practice problems
- Practice 1: Practice 1: Hash Table, Simple hash( key, M ) function
StarterSolution - Practice 2: Practice 2: Hash Table, Insert Keys until Collision
StarterSolution - Practice 3: Practice 3: Hash Table, insert with Separate Chaining, with val = count
StarterSolution - Practice 4: Practice 4: Hash Table, insert with Separate Chaining Copy
StarterSolution
🧪 Lab 18: Implementing the "DJB" hash
- Starter code
Starter
Week 10 — Units 19 & 20
Unit 19 — Practice Problems, Lab
🔧 Practice problems
- Practice 0: Practice 0: Hash Table,Incorporate folding in hash( key, M )
StarterSolution - Practice 1: Practice 1: Hash Table, Linear Probing (Open Addressing)
StarterSolution - Practice 2: Practice 2: Hash Table, Compute a Linear probing slope (Open Addressing)
StarterSolution - Practice 3: Practice 3: Hash Table, Quadratic Probing & M=pow(2, r) (Open Addressing)
StarterSolution
🧪 Lab 19: Hash Table Collision via Random Probing
- Starter code
Starter
Unit 20 — Lab
🧪 Lab 20: Delete Every Kth Node (optional)
- Starter code
Starter
Week 11 — Units 21 & 22, HW 6
Unit 21 — Practice Problems, Lab, HW 6
📝 HW 6 - Connected Components (Undirected Graphs)
- Book of Stones
Starter - Reference solution (worked example)
Solution - Electrical Grid
Starter - Star Wars Alliances
Starter - Virus Alert
Starter
🔧 Practice problems
🧪 Lab 21: Graphs (undirected) Print "Friends of Friends" for a Graph Vertex
- Starter code
Starter
Week 12 — Units 23 & 24
Unit 23 — Practice Problems, Lab
🔧 Practice problems
- Practice 1: Practice 1: Graphs, Finding Paths via Breadth-First-Search (BFS)
StarterSolution - Practice 2: Practice 2: Graphs, Paths, adding distance to Path::bfs()
StarterSolution - Practice 3: Practice 3: Graphs, Is Bipartite? using Bipartite :: dfs( )
StarterSolution - Practice 4: Practice 4: Graphs, Finding Cycles using CycleFinder:: dfs( )
StarterSolution
🧪 Lab 23: Graphs, Paths - Find Shortest Distance using BFS
- Starter code
Starter
Week 13 — Units 25 & 26, HW 7
Unit 25 — Practice Problems, HW 7
Week 14 — Units 27 & 28
Unit 27 — Practice Problems, Lab
Week 15 — Units 29 & 30, HW 8
Unit 29 — HW 8
📝 HW 8 - Maximum Flow (DIRECTED Graphs)
- Starter code
Starter
Week 16 — Units 31 & 32
Unit 31 — Practice Problems, Lab
🔧 Practice problems
- Practice 1: Practice 1: Brute Force String Search
StarterSolution - Practice 2: Practice 2: Brute Force String Search (Backing Up approach)
Solution - Practice 3: Practice 3: State Machines Intro
StarterSolution - Practice 4: Practice 4: Knuth-Morris-Pratt String Search, printDF() method
StarterSolution - Practice 5: Practice 5: Boyer-Moore String Search
StarterSolution
🧪 Lab 31: Knuth-Morris-Pratt DFA Matrices (Optional)
- Starter code
Starter