| Week | Class Meetings | Readings & Homework | Handouts & Code | 
| Week 10 Oct 27–Oct 31 | 
Oct 31: Greedy techniques [L Ch 9 intro];
  spanning trees I: Prim’s algorithm [L 9.1]
Oct 29: Knapsack problem & memory functions [L 8.2]
Outline
Oct 27: Class canceled
 |  | 
knapsack.cpp[C++ source] UNFINISHEDKnapsack problem
 | 
| Week 9 Oct 20–Oct 24 |  | 
Online Quiz 9—on
Canvas
Due 5 pm Sun, Oct 26
Oct 24: Read L 8.2.
Oct 22: Read L Ch 8 intro, 8.1.
Oct 20: Read L 7.4.
Assignment 4 (Various)
Due 5 pm Tue, Oct 28
 | 
coinrow.cpp[C++ source]Bottom-up dynamic programming example
fibo_dp_bottomup.cpp[C++ source]Computing Fibonacci numbers
 Dynamic programming (bottom-up)
use_hash.cpp[C++ source]C++ Hash Table demo
 | 
| Week 8 Oct 13–Oct 17 | 
Oct 17: Space-time trade-offs [L Ch 7 intro];
  sorting by counting [L 7.1]
Outline
Oct 15: Heaps & heap sort [L 6.4];
  problem reduction [L 6.6]
Outline
Oct 13: Balanced search trees [L 6.3]
Outline & Supplemental Notes
 | 
Online Quiz 8—on
Canvas
Due 5 pm Sun, Oct 19
Oct 17: Read L 7.3.
Oct 15: Read L Ch 7 intro, 7.1.
Oct 13: Read L 6.4, 6.6.
 | 
dist_count_sort.cpp[C++ source]Distribution Counting Sort
comp_count_sort.cpp[C++ source]Comparison Counting Sort
euclid.py[Python 3 source]Euclid’s Algorithm: GCD & LCM
introsort.cpp[C++ source]Introsort
 Requires
 heap_algs.hppheap_algs.hpp[C++ header]Header for Heap algorithms
 There is no associated source file.
heap_sort.cpp[C++ source]Heap Sort
 Requires
 heap_algs.hpp | 
| Week 7 Oct 6–Oct 10 | 
Oct 10: Midterm Exam
Oct 8: Geometric problems (cont’d) [L 5.5];
  Transform and Conquer [L Ch 6 intro];
  presorting [L 6.1];
Outline
Oct 6: Multiplication (cont’d) [L 5.4];
  geometric problems [L 5.5]
Outline & Supplemental Notes
 | 
Online Quiz 7—on
Canvas
Due 5 pm Sun, Oct 12
Oct 10: Read L 6.3.
Oct 6: Read L Ch 6 intro, 6.1.
 | 
closest_pair_dc.cpp[C++ source]Closest-Pair, Divide and Conquer Solution
 | 
| Week 6 Sep 29–Oct 3 |  |  | 
Midterm Exam Review Problems
bintree_traverse.cpp[C++ source]Binary Tree traversals: preorder, inorder, postorder
quicksort.cpp[C++ source]Hoare Partition & Quicksort
iterative_merge_sort.cpp[C++ source]Iterative Merge Sort using random-access iterators
merge_sort.cpp[C++ source]Merge Sort using iterators
In-Class Worksheet 1: The Master Theorem—Solutions [PDF]
Worksheet distributed in class Mon, Sep 29
In-Class Worksheet 1: The Master Theorem [PDF]
Worksheet distributed in class Mon, Sep 29
inversions_test.cpp[C++ source]Test program for function template
 inversionsUsed in Assignment 3, Exercise B
contigsum_test.cpp[C++ source]Test program for function template
 contigSumUsed in Assignment 3, Exercise A
 | 
| Week 5 Sep 22–Sep 26 |  | 
Online Quiz 5—on
Canvas
Due 5 pm Sun, Sep 28
Sep 26: Read L Ch 5 intro, 5.1.
Sep 24: Read L 4.5.
Sep 22: Read L 4.4.
 | 
introselect.cpp[C++ source]Introselect with Lomuto Partition
mom_select.cpp[C++ source]Median-of-Medians Selection
quickselect.cpp[C++ source]Quickselect with Lomuto Partition
rpmult.cpp[C++ source]Russian peasant multiplication
binary_search.cpp[C++ source]Binary Search using iterators
 | 
| Week 4 Sep 15–Sep 19 |  |  | 
topological_sort.cpp[C++ source]Topological sort
 Uses find-source algorithm
bridges_test.cpp[C++ source]Test program for function
 bridgesUsed in Assignment 2, Exercise A
 Uses the “doctest” unit-testing framework, version 2
 Requires
 doctest.h,bridges.hpp,bridges.cppinsertion_sort_vector_recurse.cpp[C++ source]Insertion Sort on a
 vector, recursiveCoding Standards
graph_traverse.cpp[C++ source]Graph traversals: DFS & BFS
 | 
| Week 3 Sep 8–Sep 12 | 
Sep 12: Brute force for geometric problems [L 3.3]
Outline
Sep 10: Algorithmic strategies, brute force, exhaustive search [L Ch 3 intro];
  simple brute-force methods [L 3.1–3.2]
Outline & Supplemental Notes
Sep 8: Analysis examples [L 2.5, Appendix B]
Outline
 | 
Online Quiz 3—on
Canvas
Due 5 pm Sun, Sep 14
Sep 12: Read L 3.4, 3.5.
Sep 10: Read L 3.3.
Sep 8: Read L Ch 3 intro, 3.1,
  3.2 (skip string-matching material).
   | 
closest_pair_bf.cpp[C++ source]Closest Pair, Brute Force solution
selection_sort_vector.cpp[C++ source]Selection Sort on a
 vectorbubble_sort_vector.cpp[C++ source]Bubble Sort on a
 vectorfibo_matrix.py[Python 3 source]Computing Fibonacci numbers
 Based on matrix product
fibo_iterate.py[Python 3 source]Computing Fibonacci numbers
 Iterative
fibo_recurse.cpp[C++ source]Computing Fibonacci numbers
 Recursive (return 2, with wrapper)
fibo_iterate.cpp[C++ source]Computing Fibonacci numbers
 Iterative
fibo_recurse_slow.cpp[C++ source]Computing Fibonacci numbers
 Slow recursive method
 | 
| Week 2 Sep 1–Sep 5 | 
Sep 5: Analyzing recursive algorithms [L 2.4, Appendix B]
Outline
Sep 3: Analyzing nonrecursive algorithms [L 2.3, Appendix A]
Outline
Sep 1: No class (Labor Day)
 |  | 
num_bits.cpp[C++ source]Count bits in binary representation
factorial_recurse.cpp[C++ source]Recursive computation of a factorial
insertion_sort_vector.cpp[C++ source]Insertion Sort on a
 vector | 
| Week 1 Aug 25–Aug 29 | 
Aug 29: Asymptotic notation [L 2.2]
Outline
Aug 27: Framework for analysis of algorithms [L Ch 2 intro, 2.1]
Outline
Aug 25: Course introduction;
  introduction to analysis of algorithms [L Ch 1]
Outline
 |  |  |