Exam 7: Sets and Maps

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Which of the following is an example of a map?

Free
(Multiple Choice)
4.9/5
(46)
Correct Answer:
Verified

B

An alternative to open addressing is a technique called _____________________.

Free
(Short Answer)
4.9/5
(35)
Correct Answer:
Verified

chaining

A NavigableSet (NavigableMap) allows the programmer to create _____________ of a Set (Map).

Free
(Short Answer)
4.8/5
(33)
Correct Answer:
Verified

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 union of two sets A, B is a(n) ____.

(Multiple Choice)
4.7/5
(33)

The intersection of sets A, B is a set ____.

(Multiple Choice)
4.9/5
(40)

Method ____ creates a set view of the entries in a Map.

(Multiple Choice)
4.8/5
(31)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)