Exam 11: Sets and Dictionaries

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What happens when two keys map to the same index after a hashing function has been applied?

(Multiple Choice)
4.8/5
(36)

The dictionary constructor has two optional collection arguments: a collection of keys and a collection of corresponding values.

(True/False)
4.8/5
(37)

The simplest implementations of sets are subclasses of which other class?

(Multiple Choice)
4.7/5
(34)

Much like a list, a set contains items that are in a particular order.

(True/False)
4.9/5
(46)

Two keys that hash to the same index is called a collision.

(True/False)
4.8/5
(38)

Referring to the keysToIndexes function, what is the result of the following statement? keysToIndexes([ 39, 18, 4, 51, 6, 28 ], 9)

(Multiple Choice)
4.8/5
(36)

If S1 and s2 are sets, the expression s1.issubset(s2) returns True if s2 is a subset of s1 .

(True/False)
4.8/5
(34)

The data in sets and dictionaries are ordered by position by default.

(True/False)
4.7/5
(34)

What strategy for implementing sets attempts to approximate random access into an array for insertions, removals, and searches?

(Multiple Choice)
4.8/5
(31)

What is the value of set S after the following operations? S = set([ 3, 9, 6 ]) S.add(6) S.add(4) S.remove(6)

(Multiple Choice)
4.7/5
(35)
Showing 41 - 50 of 50
close modal

Filters

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