|
Department of Computer Science |
University of San Francisco |
Computer Science 245-01
Data Structures and Algorithms
Spring 2005
MW 3:30-5:15 HR 235
Professor: Peter Pacheco
Office: Harney 540
Phone: 422-6630
Email:
peter@usfca.edu
Office Hours: MW 5:30-7:00 and by appointment
TA: Anna Tikhonova
Email:
atikhono@cs.usfca.edu
Course Syllabus
Information on the Final Exam
Homework Assignments
- Assignment 1. Due Monday, Jan 31 at the beginning of class
- Assignment 2. Due Monday, Feb 7.
Add the dummy header to the linked list class
StudentDB.java.ll
and modify the methods so that the constructor,
insertStudent, member, getStudent,
and printDB all work correctly.
- Assignment 3. Due Monday, Feb 14. Modify
StudentDB.java.ll2
so that it uses a doubly-linked list instead of
a singly-linked list.
- Assignment 4. Due Wednesday, Feb 23, Modify
TohStack.java so that
it uses an array instead of a linked list. The
other classes in the program are
TohI.java and TohNode.java.
- Assignment 5. Due Monday, March 7. Use this
code to study the average
heights of binary search trees. Write a main method
(and any other methods you need) so that the code
finds the average height of binary search trees
with a given number n of keys. The average should
be taken over all possible permutations of the
keys 0, 1, . . . , n-1. What's the largest number
of keys that your program can handle?
- Assignment 6. Due Wednesday, March 30.
Here's a key to assignment 6.
- Assignment 7. Due Monday, April 11.
- pp. 219-222: 7.3abc, 7.4, 7.5
- Use mathematical induction on the number of vertices n
to prove that a free tree has n-1 edges.
Here's a key to assignment 7.
- Assignment 8. Due Monday, April 18.
Here's a key to assignment 8.
- Assignment 9. Due Monday, April 25.
Here's a key to assignment 9.
- Assignment 10. Due Monday, May 9.
- pp. 262-266: 8.4, 8.5ab, 8.8ab, 8.10ab
Use the implementations of sorting algorithms
from class.
Note that the code segment in 8.10b should read
for (i = 0; i < L.length; i++)
qsort(L, i, L.length-1);
Here's a key.
Programming Assignments
- Programming Assignment 1
- Programming Assignment 2
- Programming Assignment 3.
Here are some definitions and algorithms.
- Programming Assignment 4
Additional Information
Peter Pacheco
2005-05-12