|
Computer Science 211 Data Structures Mount Holyoke College Fall 2009
|
|
Lecture 20: BestOf Lab Discussion
Date: Friday, October 30, 2009
This fourth-hour meeting will take place in our regular
classroom, Kendade 203. After a brief discussion of the new lab
assignment, we will move upstairs to Kendade 307 for a programming
exercise.
- Announcements
- BestOf lab discussion
- A Programming Exercise. For 10 lecture assignment points,
choose one of the following to do during our meeting today. You may
do others for 5 "bonus" lecture assignment points each to help
make up for any missed lecture assignments this semester. To earn
this credit, your submission must be in by 8:35 AM on Monday
morning.
- Modify one of your programs from the Comparator lab to use
an OrderedVector instead of a MyVector. Note that you
will need to modify the data object you are using to implement
the Comparable interface to use it in an
OrderedVector.
- Modify your Two Towers lab to do thorough checking of the
input problem size. If the number specified on the command line
is not a number or is out of range, you should prompt for a
value and do the same checking. Continue until a valid number
within range is entered.
- Write a short program that builds up a long String inside a
loop using the standard + operator to concatenate
Strings to build up the result. Then, build up the same
String but use a
StringBuffer to hold the value until the end. Time the
execution of each part.
The lecture assignment due on Monday is specified on the
Lecture 19 page.