Exercises
16.3 Define each of the following terms:
a) Collection
b) Collections
c) Comparator
d) List
e) load factor
f) collision
g) space/time trade-off in hashing
h) HashMap
16.4 Explain briefly the operation of each of the following methods of class Vector:
a) add
b) set
c) remove
d) removeAllElements
e) removeElementAt
f) firstElement
g) lastElement
h) contains
i) indexOf
j) size
k) capacity
16.5 Explain why inserting additional elements into a Vector object whose current size is less than its capacity is a relatively fast operation and why inserting additional elements into a Vector object whose current size is at capacity is a relatively slow operation.
16.6 By extending class Vector, Java’s designers were able to create class Stack quickly. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access