CS 201 - Fundamentals of Programming and Algorithms II

Spring 2008

David Hovemeyer
Office / Phone
GH 118 / 717-815-6582
Office Hours
M-F 11-12
Place GH 123
Class Times M/W 3:00-4:40 PM

Fractal Contest Winners

Click to see the full-sized image.

First place - John Zumbrum Second place - Andrew Geiman Third Place - Andrew Bryant



Course Syllabus

Big-O Practice Problems, Solution

Spring 2006 Exam 1, Solution

Spring 2007 Exam 1, Solution

Spring 2008 Exam 1, Solution

Spring 2008 Exam 2, Solution

Spring 2007 Exam 2, Solution

Spring 2007 Final Exam, Solution

Recursion practice problems

Solutions: SumDigits.java, SumDigitsTailRec.java, CountVowels.javaCountVowelsTailRec.java, ReverseArray.java

Proof by induction practice problems, Solution

Course Notes

Objects, Arrays, and References

Arrays in Java

Generic Containers and Algorithms

Analysis of Algorithms


Proof by Induction

Dynamic Programming


Binary Search Trees


Java Downloads (you should download JDK 6)

Eclipse IDE (download the latest version)

How To Think Like A Computer Scientist (Java Version), by Allen B. Downey

Java API Documentation

Example code

Date Example File
Jan 28 Calculator and CalculatorTest classes (demonstrate JUnit) calculator.zip
Jan 30 Console I/O, Strings, Arrays, ArrayList lec3examples.zip
Feb 4 Animal classes (demonstrate inheritance/polymorphism) animals.zip
Feb 6 Shape classes and tests (demonstrate JUnit) shape.zip
Feb 6 Why you can't (in general) compare objects using == and != objequals.zip
Feb 18 Solution to Lab 5 using sub-optimal O(N2) algorithm infiniteArray.zip
Feb 20 Demonstration of generic collection using java.lang.Object genericdemo1.zip
Feb 20 Demonstration of generic collection using type parameter genericdemo2.zip
Mar 6 Partial solution to Lab 7 (just YCPArrayList) lab7_partialSolution.zip
April 2 Cocktail sort (the sorting algorithm we discussed in class) lecture16sort.zip
April 7 Sorting demo programs (just double-click on the jar file) sortDemo.jar
April 28 Name list (demonstrate file I/O and exceptions) namelist.zip


Assignment File Due
Assignment 1: YCP Invaders
Updated 2/1, 2/11
CS201_Assign1.zip Friday, February 15th by 11:59 PM
Assignment 2: Benchmarking InfiniteArray n/a Friday, March 7th by 11:59 PM
Assignment 3: Linked Lists
Updated 3/17/2007
see description Wednesday, March 26th by 11:59 PM
Assignment 4: Web Spider
Updated 4/7/2007
CS201_Assign4.zip Friday, April 11th by 11:59 PM
Assignment 5: Binary Tree Traversal Algorithms CS201_Assign5.zip Monday, April 21st by 11:59 PM
Assignment 6: Expert System CS201_Assign6.zip Friday, May 2nd by 11:59 PM
Assignment 7: Fractals CS201_Assign7.zip Thursday, May 8th by 11:59 PM


Date Lab File
Jan 22 Lab 1: Coins class lab1.zip
Jan 28 Lab 2: Testing using JUnit lab2.zip
Jan 30, Feb 4 Lab 3: Post Office lab3.zip
Feb 6, Feb 11 Lab 4: Particle Man lab4.zip
Feb 13, Feb 18 Lab 5: InfiniteArray lab5.zip
Feb 20 Lab 6: Modifying a GUI Program lab6.zip
Mar 6, Mar 10 Lab 7: Lists and Iterators lab7.zip
Mar 19 Lab 8: Palindromes lab8.zip
Mar 31 Lab 9: Binomial Coefficient lab9.zip