☑ MCQ PRACTICE

Data Structures Unit 2

Practice objective questions for quick revision and examination preparation. Try answering each question before revealing the answer.

📚 Data Structures
📖 Unit 2
🎯 MCQs

Data Structures - Unit-2

1
What is a hash table?
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
2
What is direct addressing?
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
3
What is a hash function?
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
4
Which of the following is not a technique to avoid a collision?
AMake the hash function appear random
BUse the chaining method
CUse uniform hashing
DIncreasing hash table size
Correct Answer Increasing hash table size
5
What is the advantage of the hash table over a linked list?
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
6
Which of the following trait of a hash function is most desirable?
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
7
What is the hash function used in the division method?
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
8
Which of the following schemes does quadratic probing come under?
Arehashing
Bextended hashing
Cseparate chaining
Dopen addressing
Correct Answer open addressing
9
Which among the following is the best technique to handle collision?
AQuadratic probing
BLinear probing
CDouble hashing
DSeparate chaining
Correct Answer Quadratic probing
10
What is the formula used in 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
11
What is the hash function used in Double Hashing?
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
12
Which of the following is not a collision resolution technique?
ASeparate chaining
BLinear probing
CQuadratic probing
DExtendible hashing
Correct Answer Extendible hashing
13
Which of the following operations are done in a hash table?
AInsert only
BSearch only
CInsert and search
DReplace
Correct Answer Insert and search
14
Which of the following is identical to that of a separate chaining hash node?
ALinked list
BArray
CStack
DQueue
Correct Answer Linked list
15
Which of the following is a disadvantage of using separate chaining using linked lists?
AIt requires many pointers
BIt requires linked lists
CIt uses array
DIt does not resolve collision
Correct Answer It requires many pointers
16
What is a skip list?
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
17
The nodes in a skip list may have many forward references. their number is determined
Aprobabilistically
Brandomly
Csequentially
Dorthogonally
Correct Answer probabilistically
18
Which of the following is an advantage of open addressing over separate chaining?
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
← Back to All MCQs