Computer Science 210
Data Structures

Fall 2017, Siena College

Lecture 26: Ordered Structures
Date: Monday, November 13, 2017


Agenda

Lecture 26 Assignment

Due at the start of class, Friday, November 17.

Please submit answers to these questions in Blackboard under "Lecture 26 Assignment" by the start of class. We will discuss these questions at the start of class, so no late submissions can be accepted.

  1. Consider the following three options:
    1. a standard Vector/ArrayList
    2. a MyVector from the sorting project, which is capable of sorting its contents on demand (by calling the sort method)
    3. 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. (9 points)

  2. 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. (6 points)

Terminology