Computer Science 211
Data Structures

Mount Holyoke College
Fall 2009


Lecture 05: Generics; Asymptotic Analysis
Date: Monday, September 21, 2009

Agenda

Examples

Lecture Assignment

Due at the start of class, Wednesday, September 23.

Turn in short answers to these questions. Please turn in a hard copy (typeset or handwritten are OK). We will discuss these problems during class, so no late submissions are accepted.

  1. Recall the BitVector class from Bailey Problem 3.6. What declaration using the generic Vector class comes closest to this? What are the relative advantages and disadvantages of using the BitVector vs. the generic Vector? Be sure to consider memory usage of each approach in your comparison.
  2. Write a reverse method for the generic version of the Vector class in structure.