CS 223 - Spring 2017. 4/12

Welcome to CS 223!

Logical problem of the day


int main()
  int j=43;

  return 0;
What is going on here?

Lecture 21: Dynamic Programming


  • Office hours:
    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

    Assignment 6

    Problem set 6

    See piazza note Note: this means that you do not call destroyHeap in Fire.c. (Why?)

    Assignment 7

    Problem set 7

    video of 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.

    Final Exam

    In class on Monday April 24th. Topics for final exam and 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. Introduction Animation C++ Implementation rb.cpp
  • C++

    B Trees

  • Data Structure Visualizations
  • Aspnes: B trees
  • https://en.wikipedia.org/wiki/B-tree
  • https://en.wikipedia.org/wiki/B+ tree

    Dynamic Programming

  • 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 memoization.
  • 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.c lis_test.c longest increasing subsequence, from Aspnes.