Recent questions tagged hashing

3 3 votes
1 1 answer
166
166 views
An initially empty hash table $\text{HT}$ has length $11$.The hash function is:$H(key)=key \bmod 7$Collisions are resolved using linear probing.The following keys are ins...
1 1 vote
1 1 answer
172
172 views
Let $G$ be a directed graph with nonnegative edge weights.Run Dijkstra's algorithm from source $s$. After the algorithm terminates, use the $\text{prev}$ pointers to cons...
0 0 votes
1 1 answer
128
128 views
A linear-probing hash table of length $10$ uses:$h(k) = k \bmod 10$After inserting eight keys into an initially empty table, the table is:$$\begin{array}{|c|c|c|c|c|c|c|c...
0 0 votes
1 1 answer
136
136 views
When hashing is used for table addressing, a collision-resolution method is generally required.Why?Collision handling is required only when the table is completely full. ...
6 6 votes
1 1 answer
350
350 views
For the keys:$47, 61, 36, 52, 56, 33, 92$consider the hash function:$h(k) = ((10k + 4) \bmod c) \bmod 7$Find the smallest positive integer $c$ such that no collisions occ...
5 5 votes
1 1 answer
236
236 views
Which of the following statements are true?$\text{S1}$. The worst-case complexity of checking whether an object is present in a hash set is $O(1)$.$\text{S2}$. The worst-...
7 7 votes
1 1 answer
248
248 views
Insert the keys$47, 61, 36, 52, 56, 33, 92$in order into a hash table of size $7$ using:$h(k) = (10k + 4) \bmod 7$Each slot stores a linked list, and later insertions are...
5 5 votes
2 2 answers
274
274 views
A key consists of three uppercase English letters. The hash value $h$ of a key is calculated as:$h = (\text{sum of alphabetical positions of the three letters}) \bmod 27$...
7 7 votes
3 3 answers
255
255 views
A hash table has size $10$. Each key is a lowercase English alphabet character from $a$ to $z$.The hash value of a key is defined as the last digit of its decimal ASCII c...
4 4 votes
3 3 answers
219
219 views
Which of the following factors affect the average search length in hashing?Load factor Hash function Collision resolution method Only I and II Only I and III Only II and ...
4 4 votes
2 2 answers
195
195 views
A hash table of length $11$ is initially empty. The hash function is:$H(key) = key \bmod 7$Collisions are resolved using linear probing.The following keys are inserted in...
5 5 votes
3 3 answers
295
295 views
A hash table of length $11$ is initially empty. The hash function is:$H(key) = (key \times 3) \bmod 11$Collisions are resolved using quadratic probing:$H_k = (H_0 + k^2) ...
3 3 votes
1 1 answer
208
208 views
The following hexadecimal data items are inserted into a hash table in the given order:$\text{1A, ~35, ~3B, ~54, ~8E, ~A1, ~AF, ~B2, ~B3}$The hash value is computed usin...
3 3 votes
1 1 answer
168
168 views
A hash table $\texttt{hashArray}$ has $5$ positions, indexed from $1$ to $5$. Initially,$\texttt{hashArray = \{-1, -1, -1, -1, -1\}}$The value $\texttt{-1}$ means that th...
4 4 votes
1 1 answer
159
159 views
Which of the following are open addressing approaches for resolving collisions in a hash table?Linear probing Quadratic probing Exponential hashing Separate chaining
3 3 votes
1 1 answer
171
171 views
A hash table uses open addressing with linear probing. Suppose a key is deleted from the table.Why should we not simply replace the deleted key’s slot by $\text{NULL}$?Be...
3 3 votes
1 1 answer
166
166 views
A hash table of size $5$ uses open addressing with linear probing.The probing function is:$H(k,i) = (k+i) \bmod 5$where $i$ is the collision count.Insert the keys in the ...
2 2 votes
1 1 answer
197
197 views
Consider the following statements about hash tables.$\text{S1}:$ The worst-case complexity of checking whether an object is present in a hash set is $O(1)$.$\text{S2}:$ T...
2 2 votes
1 1 answer
186
186 views
For the keys : $\text{47, 61, 36, 52, 56, 33, 92}$Suppose the hash function is :$h(k) = ((10k + 4) \bmod c) \bmod 7$where $c$ is a positive integer.What is the smallest v...
4 4 votes
2 2 answers
229
229 views
Insert the integer keys$47, 61, 36, 52, 56, 33, 92$in the given order into a hash table of size $7$.The hash function is:$h(k) = (10k + 4) \bmod 7$Collisions are resolved...
6 6 votes
6 6 answers
2.0k
2.0k views
The keys $5,28,19,15,26,33,12,17,10$ are inserted into a hash table using the hash function $h(k)=k \bmod 9$. The collisions are resolved by chaining. After all the keys ...
10 10 votes
2 answers 2 answers
1.7k
1.7k views
Consider a hash table $P[0,1, \ldots, 10]$ that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is $h(x...
4 4 votes
2 2 answers
845
845 views
Consider a hash table of size $11$ that uses the hash function\[h(x)=(x+7)\bmod 11\]Keys are inserted in the order\[13,\,22,\,15,\,11,\,29,\,39,\,44\]The collision resolu...
3 3 votes
2 2 answers
447
447 views
A hash table of size 11 using the hash function h(x)=x mod 11 and quadratic probing with hi(x)=(h(x)+i^2)  mod 11 , i∈{0,1,2,…,10}.The key values are given in the followi...
1 1 vote
1 1 answer
307
307 views
A hash table of size m=13m = 13m=13 usesh(k,i)=(k mod 13+i(1+k mod 11)) mod 13h(k, i) = (k \bmod 13 + i(1 + k \bmod 11)) \bmod 13h(k,i)=(kmod13+i(1+kmod11))mod13What is t...
2 2 votes
1 1 answer
342
342 views
Match List I with List II$\begin{array}{|ll|ll|} \hline \textbf{List I} & \textbf{(Hashing Collison} & \textbf{List II} & \textbf{(Strategy)} \\ &\textbf{Handling Method)...
2 2 votes
1 1 answer
282
282 views
Which of the following symbol table implementation is best suited if access time is to be minimum?Linear listSearch treeHash TableSelf organisation list
2 2 votes
1 1 answer
387
387 views
Which data structure is typically used to implement hash table?Linked listArrayBinary TreeStack
3 3 votes
1 1 answer
513
513 views
Which collision resolution technique involves maintaining a linked list of collided keys?Linear probingQuadratic probingChainingDouble hashing
2 2 votes
1 1 answer
411
411 views
Which of the following is/are NOT CORRECT statement?The first record in each block of the data file is known as actor record.Dense index has index entries for every searc...