• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/10

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

10 Cards in this Set

  • Front
  • Back
Define Collection
Used to organize multiple objects. A ___ groups together elements and allows them to be retrieved later.
examples: Lists, Sets, Maps, Stacks
Define List
Used to organize objects when order is necessary. A ___ is a collection that remembers the *order* of its elements
Define Set
A __ collection is an *unordered* collection of unique elements.
Define Map
A ___ collection keeps associations between *keys* (stored as sets) and *values*(stored as lists) objects. Every key has an associative value.
Define Linked List
A __ ___ consists of a number of nodes, each of which has a reference to the next node. A node is an object that stores and element and references to the neighboring nodes in the sequence. [ Tom ] <—> [ Diana ] <—> [ Harry ] —> [...]
LinkedList list = new LinkedList<>();
list.addLast("Harry"); list.addFirst("Sally");
Define List Iterator
A ___ ___ is used to access elements inside a linked list. By using a position within the list, the ____ ____ points between two elements.
LinkedList employees ...
________ example = employees.______();
Do linked lists take more storage space than arrays of the same size?
*Yes*, for two reasons:
(1) A LinkedList needs to store the neighboring node references - not needed in array.
(2) There is overhead for storing an object. In a linkedList each node is a seperate object that incurs its own overhead, wheras an array in a single object.
Why don't we need iterators with arrays?
Because in arrays we can simply access each element with an integer *index.*
Consider the types HashSet and ThreeSet. Do they have anything in common?
The HashSet and ThreeSet both implement the Set Interface.
The two provide implementations based on hash tables or binary search trees. These arrange the elements so that they can locate them quickly.
Write a loop that removes all strings with length less than four from a linked list of strings called words
*ListIterator myIter = words.iterator();
while (myIter.hasNext()) {
String str = iter.next();
if (str.length() < 4) { myIter.remove(); }
} *