These are mostly summaries, outlines, or excerpts of the material seen in lectures.
Week 1
Mon, Jan 7
Opening slide
Course information sheet (postscript)
Tue, Jan 8
Notes on makefiles
Thu, Jan 10
Makefile example
What can happen if you forget the "inline" keyword in a header file
A quick review of C and bits of C++
Suggested readings: Lippman et al., sections 1.1-1.3
(and if you need to brush up on your C,
skim chapters 3-5 as necessary)
Week 2
Mon, Jan 14
Review of C++ - classes etc
Suggested readings: Lippman et al., sections 13.1-13.3, 14.1-14.3
Tue, Jan 15
More C++ - references, the const keyword, assertions
Thu, Jan 17
Dirty bits and lazy evaluation - a case study
Returning references
Shallow vs deep copy
Week 3
Mon, Jan 21
Inheritance
Suggested readings: Lippman et al., chapters 17, 18
(skim as necessary)
Tue, Jan 22
How to swap two arrays quickly
Inheritance
Thu, Jan 24
Constructors and initialization
Templated classes
Operator overloading
Slide - comments on C++
2D arrays
Suggested readings: Lippman et al., chapters 15 and 16
Week 4
Mon, Jan 28
Exceptions
Suggested reading: Lippman et al., chapter 11
The static keyword
Suggested reading: Lippman et al., sections 8.3.3 and 13.5
Tue, Jan 29
Some definitions
Stacks and the call stack
Recursion
Suggested readings: Shaffer,
chapter 1 (skim), with problems 1.8, 1.7, 1.15, 1.14, and 1.2;
and chapter 2 (especially 2.4 if you haven't seen the towers
of Hanoi before, and 2.6 if you're not familiar with induction)
Thu, Jan 31
The Golden Ratio
The Ackermann function
Fractals
Applets demonstrating fractals
The Mandelbrot fractal
Introduction to big-oh notation
More applets! - (donated by Victor Wu)
These applets draw the Mandelbrot fractal and a selected Julia set
Week 5
Mon, Feb 4
Assignment 1 handed back
Assignment 1 post mortem: how to design fiendish test cases !
Formal definitions of big O(), big Omega(), big Theta()
Also little o() and little omega()
Some properties of O() and its friends
Suggested readings: Shaffer, section 3.4
Tue, Feb 5
Running time analysis examples
Proof-by-induction example
Discussion of future assignments
Thu, Feb 7
Space/time tradeoff examples
- how to detect duplicates in an array
- how to find the nearest common ancestor of two leaf nodes in a tree
How to write a quine: a hint
Swapping two variables without using a temporary variable
Week 6
Mon, Feb 11
Habits, style, and philosophy for better programming
Linear data structures: arrays and linked lists
A solution to the quine puzzle
Tue, Feb 12
More on linear data structures: linked lists, stacks, queues
Preview of Assignment 3
Suggested reading: Shaffer, chapter 4
Thu, Feb 14
Discussion of Assignment 3
Overview of event driven programs
Introduction to STL and iterators
Week 7
Reading week.
Week 8
Mon, Feb 25
Assignment 2 post mortem
Finished linear data structures:
Evaluating postfix (reverse Polish notation) expressions
Deques
How to rotate an array
Counting bits
Tue, Feb 26
Spaghetti sort
Insertion sort, Selection sort, Bubble sort
Suggested reading: Shaffer, chapter 7
Thu, Feb 28
Shell Sort
Unshuffle Sort
- a sorted deque is a pile
- a sorted queue is a priority queue
Tree Sort
Merge Sort
Fri, Mar 1
Midterm, 6pm-8pm, in GB405
Week 9
Mon, Mar 4
Demo of 3D sample code that can be used for Assignment 5
Look under ~mcguffi/glut_example/ on ecf.
Demo of various sorting algorithms with java applets
Quick Sort
IntroSort
Counting Sort
Radix Sort
Tue, Mar 5
Bucket Sort, Monkey Sort
Introduction to Trees: some terminology
Suggested reading: Shaffer sections 5.1-5.3 and 6.1-6.4.
The Thue-Morse sequence
Duff's Device
Thu, Mar 7
More on trees
Introduction to Binary Search Trees
Suggested reading: Shaffer section 5.4.
Puzzle: to increment a random semi-infinite binary string,
how many bits must be flipped on average ?
Assignment 3 due.
Week 10
Mon, Mar 11
More on Binary Search Trees
Tue, Mar 12
Heaps, heapsort, and priority queues
Suggested reading: Shaffer sections 5.5 and 7.6.
Thu, Mar 14
Balanced Search Trees and AVL trees
Suggested reading: Shaffer section 13.2.1
Week 11
Mon, Mar 18
Midterm post mortem
Game Trees, the minimax algorithm, and alpha-beta pruning
Tue, Mar 19
Hashing and Hash Tables
Suggested reading: Shaffer section 9.4
Thu, Mar 21
Conclusion of Hash Table material
Factoids:
The Euler-Mascheroni constant (gamma=0.57721566...) is
suspected to be transcendental, but has not yet been
proven to be irrational !
If gamma were a rational of the form a/b, it is known that
b would have to be greater than 10^10000.
How to find subvector of maximal sum, in linear time !
Puzzle: What's the next term in the sequence 0, 1, 2, 720!, ... ?
Week 12
Mon, Mar 25
Assignment 4 due at 5 am.
Introduction to graphs.
Suggested reading: Shaffer chapter 11
Tue, Mar 26
Assignment 5 proposal due in lecture.
More on graphs.
Thu, Mar 28
Assignment 3 post mortem.
Discussion of Assignment 5 proposals.
- tips for implementating simulations,
maze generators and maze solvers,
and game players
Factoids: the following numbers are all transcendental
Liouville's number
l = Sum_{n=1}^inf 1/10^(n!) = 0.110001...
Champernowne's constant
0.123456789101112131415...
Thue-Morse constant
written in base 2: 0.0110100110010110...
More on graphs.
Week 13
Mon, Apr 1
More on graphs
Topological Sort
Cool facts about topology and the Euler characteristic
of a (connected and compact) surface.
Tue, Apr 2
CLR exrecise 23.4-3: Give an algorithm that tests for cycles in an
undirected graph, in O(|V|) time.
Hint: a free tree can be defined as:
a connected, undirected graph where |V|=|E|+1.
Minimal spanning trees.
Thu, Apr 4
Finished MST stuff.
Dijkstra's Algorithm for finding single-source shortest-paths.
Finished graph algorithms
A quadrastically convergent algorithm for computing pi.
Week 14
Mon, Apr 8
Fast Fourier transforms and arbitrary precision arithmetic.
Dynamic programming.
Tue, Apr 9
Finished Dynamic programming.
Set cardinality, and countably infinite vs uncountably infinite sets.
Cantor's diagonal slash.
Thu, Apr 11
Assignment 5 final report due.
Turing Machines, Universal Turing Machines, the halting problem.
Complexity classes, NP-completeness.