Data Structures :: Hashing

Home > Technical Aptitude > Data Structures > Hashing > General Questions

NA
SHSTTON
14
Solv. Corr.
16
Solv. In. Corr.
30
Attempted
0 M:0 S
Avg. Time

1 / 3

Choose the correct option.

If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the expected number of collisions involving a particular key x is :


Aless than 1

Bless than n.

Cless than m.

Dless than n/2.

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
9
Solv. Corr.
27
Solv. In. Corr.
36
Attempted
0 M:0 S
Avg. Time

2 / 3

Choose the correct option.

The hash function is
H1(k) = k % 50.
In the case of collision, the hash function used is
H(k) = (H1(k) + M x H2(k)) % 50
where H1(k) = k % 50 and H2(k) = k % 20.
M is initialized to 0 and is incremented by 1 each time a collision occurs.
This could be categorized under which of the following collision detection technic


ALinear Probing

BQuadratic Probing

CRe-Hashing

DDouble Hashing

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
25
Solv. Corr.
38
Solv. In. Corr.
63
Attempted
0 M:0 S
Avg. Time

3 / 3

Choose the correct option.

Which of these are core interfaces in the collection framework. Select the one correct answer.


ATree

BStack

CQueue

DMap

ELinkedList

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace