CS 201 - Fundamentals of Programming and Algorithms II

Spring 2007

Announcement: The Final Exam will take place Wednesday, May 9th from 3 PM - 5 PM in the usual classroom (GH 123).  It will be open book and open notes (but no computers or other electronics.)

Information

Syllabus

Importing a project into Eclipse

Exam 1 from Spring 2006 [you can ignore questions 8-10], Solution

Exam 2 topics

Exam 2 from Spring 2006 [you can ignore question 8], Solution

Exam 2 from Spring 2007 Solutions

Course notes

Objects, Arrays, and References

Arrays in Java

IO, exceptions, and the Call Stack

Generic Containers and Algorithms

Analysis of Algorithms, Big-O

Recursion

Proof by Induction

Dynamic Programming

Trees

Binary Search Trees

Hash Tables

Resources

Java: java.sun.com

Download the Java Development Kit (JDK) version 1.5.0 or later.

Eclipse: www.eclipse.org

Click the link "Download Eclipse".  Download "Eclipse 3.2.1" for your platform (if there is a more recent version, download that instead).  Unzip the file you have downloaded.  You can start Eclipse by executing "eclipse.exe".  (Note that you must install the JDK before you can run Eclipse.)

Assignments

Assignment 1, due Monday, January 29th by 11:59 PM

Assignment 2, due Wednesday, February 7th by 11:59 PM

Assignment 3, due Friday, February 23rd by 11:59 PM

Assignment 4, due Monday, March 12th by 11:59 PM

Assignment 5, due Monday, March 19th by 11:59 PM

Assignment 6, due Monday, March 26th by 11:59 PM

Assignment 7, due Wednesday, April 4th by 11:59 PM

Assignment 8, due Friday, April 13th by 11:59 PM

Assignment 9, due Monday, April 23st by 11:59 PM

Assignment 10, due Wednesday, May 2nd by 11:59 PM --- Note: optional assignment, does not count towards your grade

Example Code

Example
File
Lecture 1: Point class point.zip
Lecture 2: MilesPerGallon class (showing use of Scanner for input)
mpg.zip
Lecture 2: updated Point class with computeDistance method
point2.zip
Lecture 4: Shape, Rectangle, and Square classes (and tests)
shape.zip
Lecture 5: Equality - identity-based vs. value-based
(Why you shouldn't use == or != to compare objects)
equality.zip
Lecture 6: InfiniteArray class infiniteArray.zip
Lecture 7: Generic InfiniteArray class
(with doubling storage capacity rather than grow-by-1)
infiniteArray2.zip
Lecture 8: Generic LinkedList class linkedlist.zip
Lecture 9: Generic LinkedList class (additional methods)
linkedlist2.zip
Lecture 10: Generic findElement method, running time analysis
genericmethod.zip
Lecture 16: Dynamic programming optimal change calculator
dynchange.zip
Lecture 17: Insertion sort
sort.zip
Lectures 22-23: Binary search tree (Naive and insert-only AVL versions)
bst.zip
Lecture 23: Example of text file I/O using FileReader, FileWriter, BufferedReader, PrintWriter
fileio.zip
Final lecture: Hash table implementation hashtable.zip

Labs

Lab
File
Lab 1: Coins class
lab1.zip
Lab 2: Modifying a GUI Program
lab2.zip
Lab 3: Removing an element from a LinkedList
lab3.zip
Lab 4: Palindrome detection
lab4.zip