|
Computer Science 211 Data Structures Mount Holyoke College Fall 2009
|
|
Lecture 05: Generics; Asymptotic Analysis
Date: Monday, September 21, 2009
- Announcements
- Lecture Assignment Recap
- Console I/O in Java Applications
- Generics
- Motivation
- Using a generic class
- Generic implementations of Association and Vector
- Asymptotic Analysis introduction
- SpellsVectorT.java
- PocketChangeT.java
- structure5.Association
- structure5.Vector
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.
- 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.
- Write a reverse method for the generic version of the
Vector class in structure.