Week
|
Class Meetings
|
Readings & Homework
|
Handouts & Code
|
Finals Dec 9–Dec 13
|
- Dec 9: Final Exam 1–3 pm
in the classroom
|
|
|
Week 15 Dec 2–Dec 6
|
- Dec 6: Other graph topics;
course wrap-up
Slides [PDF]
- Dec 4: Spanning trees
Slides [PDF]
- Dec 2: Graph traversals
Slides [PDF]
|
|
|
Week 14 Nov 25–Nov 29
|
- Nov 29: No class meeting (Fall Break)
- Nov 27: No class meeting (Fall Break)
- Nov 25: The rest of the course;
external data;
introduction to graphs
Slides [PDF]
|
|
|
Week 13 Nov 18–Nov 22
|
- Nov 22: Thoughts on Assignment 8;
Tables in the C++ STL & elsewhere
Slides [PDF]
- Nov 20: Hash Tables (cont’d);
Prefix Trees
Slides [PDF]
- Nov 18: Hash Tables
Slides [PDF]
|
|
reverser_test.cpp [C++ source] SKELETON
Tests for class Reverser
For Assignment 8, Exercise B
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , reverser.hpp
reverser.hpp [C++ header]
Header for class Reverser
There is no associated source file.
For Assignment 8, Exercise B
wordcount_test.txt [ASCII text file]
Test input file for Assignment 8, Exercise A
This file is also in the Git repository.
hash_function.cpp [C++ source]
Demo of a typical hash function for integers
|
Week 12 Nov 11–Nov 15
|
- Nov 15: 2-3 Trees (cont’d);
other self-balancing search trees
Slides [PDF]
- Nov 13: 2-3 Trees
Slides [PDF]
- Nov 11: Thoughts on Assignment 7;
Binary Heap Algorithms (cont’d);
Heaps & Priority Queues in the C++ STL
Slides [PDF]
|
|
introsort.cpp [C++ source]
Introsort
Requires heap_algs.hpp
Based on quicksort2.cpp
pq.cpp [C++ source]
Priority Queues & custom comparisons
heap_sort.cpp [C++ source]
Heap Sort
Requires heap_algs.hpp
treesort_test.cpp [C++ source]
Test program for function template treesort
For Assignment 7, Exercise A
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , treesort.hpp
treesort.hpp [C++ header] SKELETON
Header for function template treesort
There is no associated source file.
|
Week 11 Nov 4–Nov 8
|
- Nov 8: Priority Queues;
Binary Heap Algorithms
Slides [PDF]
- Nov 6: Binary Search Trees (cont’d);
unit overview—Tables & Priority Queues;
introduction to Tables
Slides [PDF]
- Nov 4: Binary Trees;
Binary Search Trees
Slides [PDF]
|
|
heap_algs.hpp [C++ header]
Header for Heap algorithms
There is no associated source file.
heap_algs_main.cpp [C++ source]
Simple main program for Heap algorithms
Requires heap_algs.hpp
|
Week 10 Oct 28–Nov 1
|
- Nov 1: Thoughts on Assignment 6;
Queues;
unit overview—the basics of trees;
introduction to trees
Slides [PDF]
- Oct 30: Stacks
Slides [PDF]
- Oct 28: More on Linked Lists (cont’d);
Sequences in the C++ STL
Slides [PDF]
|
|
da6_test.cpp [C++ source]
Test program for Assignment 6 templates
For Assignment 6, Exercises A, B
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , da6.hpp
fibo_bf_elim.cpp [C++ source]
rpncalc.cpp [C++ source]
Entering & evaluating Reverse Polish Notation
Requires rpneval.hpp /.cpp
rpneval.hpp [C++ header]
Header for rpnEval : Reverse Polish Notation evaluation
Example application of a Stack
rpneval.cpp [C++ source]
Source for rpnEval : Reverse Polish Notation evaluation
Example application of a Stack
|
Week 9 Oct 21–Oct 25
|
- Oct 25: Node-based structures;
more on Linked Lists
Slides [PDF]
- Oct 23: Allocation & efficiency;
generic containers;
thoughts on Assignment 5
Slides [PDF]
- Oct 21: [Class held via Zoom]
Exception safety (cont’d)
Slides [PDF]
|
|
use_list2.cpp [C++ source]
Singly Linked List example using smart pointers: create & find size
Based on use_list.cpp
Requires llnode2.hpp
llnode2.hpp [C++ header]
Header for struct LLNode2
Singly Linked List node
Based on llnode.hpp
There is no associated source file.
gfsarray_test.cpp [C++ source]
Test program for class template GFSArray
For Assignment 5, Exercise A
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , gfsarray.hpp
fsarray_main2.cpp [C++ source]
Simple program using class FSArray
Avoids resizing, swap, and assignment
Requires fsarray.hpp , fsarray.cpp
|
Week 8 Oct 14–Oct 18
|
- Oct 18: Exception safety
Slides [PDF]
- Oct 16: Basic array implementation
Slides [PDF]
- Oct 14: Where are we?;
data abstraction;
introduction to Sequences;
interface for a smart array
Slides [PDF]
|
- Online Quiz 8—on
Canvas
Due 5 pm
Sun, Oct 20
|
fsarray.hpp [C++ header] HAND-OFF
Header for class FSArray
Frightfully smart array of int
Preliminary to Assignment 5
fsarray.cpp [C++ source] HAND-OFF
Source for class FSArray
Frightfully smart array of int
Preliminary to Assignment 5
fsarray_main.cpp [C++ source]
Check whether FSArray package compiles
Requires fsarray.hpp , fsarray.cpp
|
Week 7 Oct 7–Oct 11
|
- Oct 11: Midterm Exam
- Oct 9: Non-comparison sorts;
sorting in the C++ STL
Slides [PDF]
- Oct 7: Comparison sorts III (cont’d)
Slides [PDF]
|
- Online Quiz 7—on
Canvas
Due 5 pm
Sun, Oct 13
|
comparison.cpp [C++ source]
Passing comparisons to STL sorts
Also demonstrates use of lambdas
radix_sort.cpp [C++ source]
Radix Sort for integers with specified number of digits
pigeonhole_sort.cpp [C++ source]
Pigeonhole Sort for small-ish integers
- In-Class Worksheet 2: The Master Theorem—Solutions [PDF]
Worksheet distributed in class Mon, Oct 7
- In-Class Worksheet 2: The Master Theorem [PDF]
Worksheet distributed in class Mon, Oct 7
quicksort2.cpp [C++ source]
Quicksort
Implementation #2: optimized
|
Week 6 Sep 30–Oct 4
|
- Oct 4: The limits of sorting;
comparison sorts III
Slides [PDF]
- Oct 2: Asymptotic notation;
divide and conquer;
comparison sorts II
Slides [PDF]
- Sep 30: Introduction to sorting;
comparison sorts I
Slides [PDF]
|
- Online Quiz 6—on
Canvas
Due 5 pm
Sun, Oct 6
|
|
Week 5 Sep 23–Sep 27
|
- Sep 27: Thoughts on Assignment 4;
analysis of algorithms
Slides [PDF]
- Sep 25: Recursive backtracking;
unit overview—algorithmic effiency & sorting
Slides [PDF]
- Sep 23: Search algorithms II;
eliminating recursion;
search in the C++ STL
Slides [PDF]
|
|
holeydtcount_test.cpp [C++ source]
Test program for function holeyDTCount
For Assignment 4, Exercise A
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , holeydtcount.hpp ,
holeydtcount.cpp
important.py [Python 3 source]
Print the sum from Analysis of Algorithms slides
Illustrates the most important part of a formula
nqueen_count.cpp [C++ source]
Count solutions to the n-Queens problem
Example of Recursive Backtracking
nqueen.cpp [C++ source]
Print solutions to the n-Queens problem
Example of Recursive Backtracking
binsearch4.cpp [C++ source]
Binary Search
Implementation #4: iterative (tail recursion eliminated)
binsearch3.cpp [C++ source]
Binary Search
Implementation #3: single tail-recursive call
seqsearch_compare.cpp [C++ source]
Compare Sequential Search with Binary Search
Uses Binary Search implementation from binsearch2.cpp
|
Week 4 Sep 16–Sep 20
|
- Sep 20: Thoughts on Assignment 3;
recursion vs. iteration
Slides [PDF]
- Sep 18: Search algorithms I
Slides [PDF]
- Sep 16: Unit overview—recursion & searching;
arrays & Linked Lists;
introduction to recursion
Slides [PDF]
|
|
fibo_fast.py [Python 3 source]
Computing Fibonacci numbers
Fast method
fibo_formula.cpp [C++ source]
Computing Fibonacci numbers
Formula implementation
fibo_memo.cpp [C++ source]
Computing Fibonacci numbers
Recursive top-down dynamic programming implementation
A.k.a. memoizing
fibo_recurse.cpp [C++ source]
Computing Fibonacci numbers
Fast recursive implementaton
fibo_iterate.cpp [C++ source]
Computing Fibonacci numbers
Iterative implementaton
binsearch2_list.cpp [C++ source]
Binary Search
Based on binsearch2.cpp
Same Binary Search funcgtion, but called on std::list , not std::vector
da3_test.cpp [C++ source]
Test program for Assignment 3 functions & templates
For Assignment 3, Exercises A, B, C, D
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , da3.hpp ,
da3.cpp
da3.hpp [C++ header] SKELETON
Header for Assignment 3 functions
For Assignment 3, Exercises A–D
da3.cpp [C++ source] SKELETON
Source for Assignment 3 functions
For Assignment 3, Exercises A–D
binsearch2.cpp [C++ source]
Binary Search
Implementation #2: recursive (improved)
binsearch1.cpp [C++ source]
Binary Search
Implementation #1: recursive
fibo_first.cpp [C++ source]
Computing Fibonacci numbers
First attempt: slow recursive implementation
use_list.cpp [C++ source]
Singly Linked List example: create & find size
Requires llnode.hpp
llnode.hpp [C++ header]
Header for struct LLNode
Singly Linked List node
There is no associated source file.
range.py [Python 3 source]
Example of a range specification in Python
|
Week 3 Sep 9–Sep 13
|
- Sep 13: Thoughts on Assignment 2;
error handling;
using exceptions
Slides [PDF]
- Sep 11: Containers & iterators (cont’d);
Software engineering concepts: invariants;
invisible functions II
Slides [PDF]
- Sep 9: Managing resources in a class (cont’d);
containers & iterators
Slides [PDF]
|
|
allocate2_raii.cpp [C++ source]
Out-of-memory handling using exceptions, with RAII classes
allocate2.cpp [C++ source]
Out-of-memory handling using exceptions
msarray_test.cpp [C++ source]
Test program for class template MSArray
For Assignment 2, Exercise A
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , msarray.hpp
iterators.cpp [C++ source]
Iterator & STL demo
|
Week 2 Sep 2–Sep 6
|
- Sep 6: Parameter Passing II;
invisible functions I;
managing resources in a class
Slides [PDF]
- Sep 4: Example class (cont’d);
software engineering concepts: testing;
thoughts on Assignment 1
Slides [PDF]
- Sep 2: No class meeting (Labor Day)
|
|
intarray.hpp [C++ header]
Header for class IntArray
Simple RAII class class holding dynamic array of int
There is no associated source file.
intarray_main.cpp [C++ source]
Simple program using class IntArray
Requires intarray.hpp
invisible.cpp [C++ source]
Demo of invisible functions
player_test.cpp [C++ source]
Test program for class Player
For Assignment 1, Exercise A
Uses the “doctest” unit-testing framework, version 2
Requires doctest.h , player.hpp ,
player.cpp
- Coding Standards
|
Week 1 Aug 26–Aug 30
|
- Aug 30: Example class
Slides [PDF]
- Aug 28: Software engineering concepts: abstraction;
operator overloading;
software engineering concepts: assertions
Slides [PDF]
- Aug 26: Course overview;
unit overview—advanced C++ & software engineering concepts;
expressions;
parameter passing I
Slides [PDF]
|
- Online Quiz 1—on
Canvas
Due 5 pm
Sun, Sep 1
- Aug 26: Read
“On Following Rules”.
The above date is when the reading is assigned.
The reading should be completed before
taking Online Quiz 1, which will be posted
on Friday, August 30
and due at 5 pm on Sunday, September 1.
|
|