|
Computer Science 211 Data Structures Mount Holyoke College Fall 2009
|
|
Lecture 19: Ordered Structures
Date: Wednesday, October 28, 2009
- Announcements
- We will meet for our fourth hour in our regular classroom on
Friday to go over the next assignment. We may move up to
Kendade 307 after that.
- Postscript lab continues
- Lecture Assignment Recap
- Ordered structures
- ComparableAssociations
- the OrderedStructure interface (it's empty!)
- OrderedVector
- OrderedList
- structure5.ComparableAssociation
- structure5.OrderedStructure
- structure5.OrderedVector
- structure5.OrderedList
Due at the start of class, Monday, November 2.
Turn in short answers to these questions. Please turn in a hard copy
(typeset or handwritten are OK) at or before the start of class. We
will discuss these problems during class, so no late submissions are
accepted.
- Consider the following three options:
- a standard Vector
- a MyVector from the sorting lab, which is capable of
sorting its contents on demand (by calling the sort method)
- an OrderedVector, which might be thought of as a
MyVector that automatically sorts during/after each
modification to its contents
Given a set of data which is modified periodically and printed in
order periodically, describe briefly the circumstances (relative
frequency of modifications and printouts) where each of the above
three approaches might be beneficial.
- Under what circumstances would a get method as described in
Bailey question 11.13 on p. 274 be more useful than the existing
contains method? Write a get method for
OrderedVector.