

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: DATA STRUCTURES; Subject: Computer Science; University: Oregon State University; Term: Spring 2003;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Due date: Monday, May 19, 2003 (5:00 PM) Treat this paper as a specification for your assignment. Your code will be graded on correctness, read- ability, and style. Study problems and exercises must be legible and will be graded on correctness.
What to do:
Programming:
(a) Sorted subSet(Object start, Object stop) — returns a sorted collection that contains all the elements larger than or equal to start and smaller than stop.
(b) Sorted headSet(Object stop) — returns a sorted collection that contains all the ele- ments smaller than stop.
(c) Sorted tailSet(Object start) — returns a sorted collection that contains all the ele- ments larger than or equal to start.
Written homework:
E 14.2) Show the result after inserting the values 1, 3, 1, 4, 1, 5, 9 into an initially empty binary search tree. Then show the result after deleting the root node.
E 14.6) Show all the AVL trees that could result after inserting the values 1, 2, 3, and 4 in various permutations. How many different trees are there?
E 15.3) The following tasks are intended to help you get a better feel for the implementation of the operations in the Heap data type. d. Create an initially empty heap, and verify that the method isEmpty will return true. e. Add the element 4 to the heap. Verify that isEmpty will now return false.
f. Add the value 7. Show the structure of the new heap. g. Add the value 3. Show the structure of the new heap once the new value has been moved into place. h. Add the values 8, 9, 6, and 5, and show the structure of the final heap. i. Remove the value 3, and show the heap after is has been rebuilt. j. Remove each of the remaining values one by one, and show the heap after each operation.
In class: a printout of written homework with illustrations (can be done using a text editor with additional handwritten illustrations or using Word or some other word processor) and printouts of your source files FindMax.java, AVLMaxTree.java, and BSTSet.java.
Via the web: the files Answers.txt (or Answers.doc or Answers.pdf), Find- Max.java, AVLMaxTree.java, and BSTSet.java.