Computer Science 112 Spring 2015
Gregory M. Kapfhammer
Introduction to Computer Science II
Keep in touch!

Office Hours, Email, Web, Twitter

ArrayLists
Iterators
Grow
Shrink
Direct Access
java.util.ArrayList
git pull
CreateArrayLists
Compiler Warning?
Growth Behavior
Initial Capacity
Maximum Size?
Growth Technique?
Initial Size Array
Overflow
Allocate New Array
Copy to New Array
Use the New Array
Page 264
java.util.Iterator
git pull
IteratorAndInstances
Compiler Warning?
hasNext
next
instanceof
Add a new instanceof
ArrayIndexList
git pull
Exception?
Why?
Can you fix it?
Overflow Condition
How?
private int capacity
Did overflow take place?
Review design trade-offs
Review worst-case time complexities
Page 262
Can you explain why?