# how many hash table sequences will produce a given table

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

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

• I believe thirty sequences. What do you think? – Hendrik Jan May 2 '18 at 12:15
• I believe you're right! How did you get to this? – user112112 May 2 '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 2 '18 at 12:45