Computer Science 210
Data Structures
Fall 2016, Siena College
Lecture 08: The ArrayList and Vector
Date: Friday, September 23, 2016
Agenda
- Announcements
- Proposal: move exam 1 up one week to October 5 to avoid the
busy week before our October 14 long weekend?
- Reminder: missing classes and/or labs regularly is not a
good path to success in the course
- Lab 3: Defining Classes continues
- The ArrayList, a true abstract data type
- Enhanced for loops
Lecture 08 Assignment
Due at the start of class, Monday, September 26.
Please submit answers to these
questions by the start of class. zyBook activities should be done
right in your zyBook, and all others should be submitted to
Blackboard under "Lecture 08 Assignment" . We will
discuss these questions at the start of class, so no late
submissions can be accepted.
- Write a method that takes an ArrayList of Double
values as its parameter and returns the largest value found in the
ArrayList. (5 points)
- Write a method that takes an int and an ArrayList of
Integer as parameters and returns another ArrayList of
Integer that includes only those values from the original
ArrayList that are greater than the int parameter's
value. (5 points)
- Complete Challenge Activity 9.8.1 in J+DS zyBook.
(2 points)
- Complete Challenge Activity 9.14.1 in J+DS zyBook.
(4 points)
Note: for this one, you should remove by position, not by value.
Terminology
- extensible
- vector/array list
- abstract data type (ADT)
- linear search
- autoboxing, autounboxing
- iterate
- enhanced for loop
- run time error
- compile time error
- generic/parameterized data types
Examples