0

given the following hash table with linear probing when the hash function is: $$k mod 10$$

enter image description here

how many different sequences will produce the given table? (starting from an empty table)

chendoy
  • 307
  • 1
  • 3
  • 7
  • I believe thirty sequences. What do you think? – Hendrik Jan May 02 '18 at 12:15
  • I believe you're right! How did you get to this? – chendoy May 02 '18 at 12:29
  • I got 30, as well. The elements at 2, 3, 4 and 6 can be inserted in any order, so you get 4! = 24 sequences. Of these 24, there are exactly 6 permutations where the element at 6 is last. In this case, the element at 5 can be inserted either before or after the element at 6, which adds 6 more sequences. The element at 7 has to be inserted after both the element at 5 and the element at 6, so no more new sequences exist due to the element at 7. – Mike Borkland May 02 '18 at 12:45

0 Answers0