Exam 10: Sets and Maps

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

There are no set union, set intersection, or set difference member functions in the C++ set class.

Free
(True/False)
4.8/5
(29)
Correct Answer:
Verified

True

What is the result of performing the following operation? {1, 3, 5, 7} - {2, 3, 4, 5}

Free
(Multiple Choice)
4.8/5
(45)
Correct Answer:
Verified

B

You retrieve an object from a map by specifying its __________.

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

key

The subscript operator is defined for the multimap.

(True/False)
4.9/5
(39)

What mathematicians call a(n) __________ can be thought of as a collection of objects.

(Short Answer)
4.8/5
(41)

A hash function that evaluates indexes based on an original int value modulo the size of the hash table tends to uniformly distribute keys.

(True/False)
5.0/5
(39)

The statement int index = uni_char % __________; computes an array index between 0 and 499 for a Unicode character.

(Short Answer)
4.8/5
(45)

To reduce the clustering of indexes in hash tables, __________ probing uses increments that form the series: (1 + 22+ 32; + · · ·).

(Multiple Choice)
4.7/5
(42)

Worst-case performance for a hash table or a binary search tree is O(__________).

(Multiple Choice)
4.8/5
(38)

Mathematically a(n) __________ is a set of ordered pairs whose elements are known as the key and the value.

(Short Answer)
4.8/5
(29)

Items are stored in a map as ordered by their __________ function.

(Short Answer)
4.7/5
(26)

Consider the formula for evaluating the number of hash table comparisons: c=1/2(1+1/(1L)) c=1 / 2^{(1+1 /(1-L))} , where c = the number of comparisons and L = the load factor. Given that a hash table of size 100,000 contains 20,000 items, how many comparisons are expected in a linear probe for an item?

(Multiple Choice)
4.9/5
(39)

The __________ is the same as the set except that it does not impose the requirement that the items be unique.

(Short Answer)
4.9/5
(33)

Suppose you are given two sets: Set1 = {Apples, Peaches, Pineapples} Set2 = {Apples, Grapes, Peaches} The result of set1* set2 is __________.

(Multiple Choice)
4.7/5
(38)

An alternative to open addressing is a technique called __________, in which each table element references a linked list that contains all the items that hash to the same table index.

(Short Answer)
4.7/5
(52)

Which of the following lines corrects the error in the Map class function? Which of the following lines corrects the error in the Map class function?

(Multiple Choice)
4.8/5
(41)

If the set fruits is {"Apples", "Grapes", "Oranges", "Peaches", "Pears", "Pineapples", "Tomatoes"}, Then Lower_bound("Oranges") Would return an iterator to "__________", and Upper_bound("Pineapples") Would return an iterator to "Tomatoes".

(Multiple Choice)
4.8/5
(38)

The default value for the Compare template parameter is the Key_Type's __________ operator.

(Multiple Choice)
4.9/5
(35)

Static data members must be initialized inside the class declaration.

(True/False)
4.7/5
(37)

The vector and set both implement the common requirements of the container classes.

(True/False)
4.9/5
(40)
Showing 1 - 20 of 25
close modal

Filters

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