Data Structures - Unit-2
AA structure that maps values to keys
BA structure that maps keys to values
CA structure used for storage
DA structure used to implement stack and queue
Correct Answer
A structure that maps keys to values
ADistinct array position for every possible key
BFewer array positions than keys
CFewer keys than array positions
DSame array position for all keys
Correct Answer
Distinct array position for every possible key
AA function has allocated memory to keys
BA function that computes the location of the key in the array
CA function that creates an array
DA function that computes the location of the values in the array
Correct Answer
A function that computes the location of the key in the array
AMake the hash function appear random
BUse the chaining method
CUse uniform hashing
DIncreasing hash table size
Correct Answer
Increasing hash table size
Afaster access of data
Beasy to implement
Cvery efficient for less number of entries
Dexhibit good locality of reference
Correct Answer
faster access of data
Ait should cause less collisions
Bit should cause more collisions
Cit should occupy less space
Dit should be easy to implement
Correct Answer
it should cause less collisions
Ah(k) = k/m
Bh(k) = k mod m
Ch(k) = m/k
Dh(k) = m mod k
Correct Answer
h(k) = k mod m
Arehashing
Bextended hashing
Cseparate chaining
Dopen addressing
Correct Answer
open addressing
AQuadratic probing
BLinear probing
CDouble hashing
DSeparate chaining
Correct Answer
Quadratic probing
AHash key = key mod table size
BHash key=(hash(x)+F(i)) mod table size
CHash key=(hash(x)+F(i2)) mod table size
DH(x) = x mod 17
Correct Answer
Hash key=(hash(x)+F(i2)) mod table size
A(h1(k) – i*h2(k))mod m
Bh1(k) + h2(k)
C(h1(k) + i*h2(k))mod m
D(h1(k) + h2(k))mod m
Correct Answer
(h1(k) + i*h2(k))mod m
ASeparate chaining
BLinear probing
CQuadratic probing
DExtendible hashing
Correct Answer
Extendible hashing
AInsert only
BSearch only
CInsert and search
DReplace
Correct Answer
Insert and search
ALinked list
BArray
CStack
DQueue
Correct Answer
Linked list
AIt requires many pointers
BIt requires linked lists
CIt uses array
DIt does not resolve collision
Correct Answer
It requires many pointers
Aa linkedlist with size value in nodes
Ba linkedlist that allows faster search within an ordered sequence
Ca linkedlist that allows slower search within an ordered sequence
Da tree which is in the form of linked list
Correct Answer
a linkedlist that allows faster search within an ordered sequence
Aprobabilistically
Brandomly
Csequentially
Dorthogonally
Correct Answer
probabilistically
Ait is simpler to implement
Btable never gets full
Cit is less sensitive to hash function
Dit has better cache performance
Correct Answer
it is simpler to implement
Fill in the Blanks
19
If several elements are competing for the same bucket in the hash table, what is it called?
Correct Answer
Collision
20
A good hash approach is to derive the hash value that is expected to be dependent of any patterns that might exist in the data(T/F).
Correct Answer
False
21
Collisions can be reduced by choosing a hash function randomly in a way that is independent of the keys that are actually to be stored(T/F).
Correct Answer
True
22
Hashing is the problem of finding an appropriate mapping of keys into addresses(T/F).
Correct Answer
True