edited by
26,925 views
73 votes
73 votes

A hash table of length $10$ uses open addressing with hash function $h(k) = k \: \mod \: 10$, and linear probing. After inserting $6$ values into an empty hash table, the table is shown as below
$$\begin{array}{|l|l|}\hline \text{0}  &  \text{} \\ \hline \text{1} & \text{} \\\hline  \text{2} & \text{42} \\ \hline  \text{3} & \text{23} \\\hline   \text{4} & \text{34} \\\hline   \text{5} & \text{52} \\\hline   \text{6} & \text{46} \\\hline   \text{7} & \text{33} \\\hline   \text{8} & \text{} \\\hline   \text{9} & \text{}  \\\hline \end{array}$$

How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?

  1. $10$
  2. $20$
  3. $30$
  4. $40$
edited by

10 Answers

1 votes
1 votes
Total ways = 6(factorial)

42,23,34,46 can come in any order and the order of 52 and 33 should be constant.

So 6(fact)/4(fact)=30.
Answer:

Related questions

23 votes
23 votes
3 answers
1
go_editor asked Sep 30, 2014
6,579 views
A hash table of length $10$ uses open addressing with hash function $h(k) = k \mod 10$, and linear probing. After inserting $6$ values into an empty hash table, the table...
57 votes
57 votes
12 answers
3
go_editor asked Sep 29, 2014
16,071 views
In a binary tree with $n$ nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree ...