Exam 7: Sets and Maps
Exam 1: Object-Oriented Programming and Class Hierarchies41 Questions
Exam 2: Lists and the Collections Framework35 Questions
Exam 3: Testing and Debugging25 Questions
Exam 4: Stacks and Queues28 Questions
Exam 5: Recursion25 Questions
Exam 6: Trees25 Questions
Exam 7: Sets and Maps27 Questions
Exam 8: Sorting25 Questions
Exam 9: Self-Balancing Search Trees28 Questions
Exam 10: Graphs25 Questions
Exam 11: Introduction to Java25 Questions
Exam 12: Overview of UML25 Questions
Select questions type
Which of the following is an example of a map?
Free
(Multiple Choice)
4.9/5
(46)
Correct Answer:
B
An alternative to open addressing is a technique called _____________________.
Free
(Short Answer)
4.9/5
(35)
Correct Answer:
chaining
A NavigableSet (NavigableMap) allows the programmer to create _____________ of a Set (Map).
Free
(Short Answer)
4.8/5
(33)
Correct Answer:
subsets
____ occur(s) because you can only store one key-value pair in a given array element.
(Multiple Choice)
4.8/5
(32)
If we compare hash table performance with binary search of a sorted array, the number of comparisons required by binary search is ____.
(Multiple Choice)
4.8/5
(31)
Collections implementing the Set interface must contain unique elements.
(True/False)
4.8/5
(36)
With respect to the Map interface, the ____ method returns the current value associated with a given key.
(Multiple Choice)
4.8/5
(33)
An advantage of ____________________ is that you can store more elements in the table than the number of table slots (indexes).
(Short Answer)
4.8/5
(39)
With respect to the Map interface, the ____ method either inserts a new mapping or changes the value associated with an existing mapping.
(Multiple Choice)
4.8/5
(36)
The following is an algorithm for ____.
Compute the index by taking the item's hashCode() % table.length.
If table[index] is null
The item is not in the table.
Else if table[index] is equal to the item
The item is in the table.
Else
Continue to search the table by incrementing the index until either the item is found or a null entry is found.
(Multiple Choice)
4.8/5
(37)
Using a hash table enables us to retrieve an item in O(n2) time.
(True/False)
4.8/5
(31)
Mathematically, a(n) ___________________ is a set of ordered pairs whose elements are known as the key and the value.
(Short Answer)
4.7/5
(41)
The basis of ____________________ is to transform the item's key value to an integer value which will then be transformed into a table index.
(Short Answer)
5.0/5
(35)
Although you cannot reference a specific element of a Set, you can iterate through all its elements using an Iterator object.
(True/False)
4.8/5
(42)
A NavigableSet (NavigableMap) can be traversed in reverse order.
(True/False)
4.9/5
(39)
In ____________________ addressing, search chains can overlap, so a search chain may include items in the table that have different starting values.
(Short Answer)
4.8/5
(30)
With respect to hash tables, if there are no collisions, the performance for search and retrieval is O(n), regardless of table size.
(True/False)
4.8/5
(42)
Showing 1 - 20 of 27
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)