CS 223 - Spring 2017. 4/12
Welcome to CS 223!
Logical problem of the day
What is going on here?
Lecture 21: Dynamic Programming
The office hours are
Sun/Tue/Thu 8-11 PM at Hillhouse 17 Rm 111.
My office hours this week are Wednesday 3-5pm.
The ta's have posted a poll on piazza to solicit topics for review sessions.
Check it and fill it. -- They are now offering mini review sessions.
See piazza note
Problem set 6
See piazza note Note: this means that you do not call destroyHeap in Fire.c. (Why?)
Problem set 7
another solution DO NOT IMPLEMENT THIS.
We have also released a program /c/cs223/hw7/Wordsdemo which prints
out copious intermediate results when given the debug flag.
In class on Monday April 24th.
Topics for final exam
Sample questions for final exam (from last year) (No 2-3, 2-4 trees, which are actually sub-types of B trees.)
Lecture Starts Here
Red Black Trees
Aspnes: red black trees
Red Black tree != AVL tree:
Red black trees.
- Mostly a superset of C. It is difficult, but not impossible,
to write legal C code that is not legal C++.
- Object oriented: classes, constructors (new, not
encapsulation (private, protected, public),
inheritance, polymorphism, operator overloading.
- I/O streams
- Exception handling
- Standard Library - better designed than C's.
Data Structure Visualizations
Aspnes: B trees
Aspnes: Dynamic Programming
fib.c after Aspnes. Uses
array instead of hash table. Issue with fib2(45).
See revised code in fib2.c
fib.py Python version with
Minimum coin changing problem Note: greedy algorithm is not always optimal.
Recursive solution: mcc.c
with command line args: mccargs.c
Dynamic programming solution: mccdp.c
with command line args: mccdpargs.c
(Knapsack problem, related to bin packing from hw2.)
lis_test.c longest increasing
subsequence, from Aspnes.