Certainly! I will guide you through the process of inserting records with the given keys using the specified hashing function, increment function, and the Binary Tree collision resolution method. However, I am unable to draw binary trees here, so I will only provide the steps and details for each insertion.
Let's use the following keys for insertion: 15, 47, 51, 22, 14, 58, 80, 31, 18, 13, 54.
Step 1: Create a hash table with 11 slots (0 to 10).
Step 2:
Insert the first key, 15, into the hash table using the hashing function H(key) = key mod 11. The hash value for 15 is 4, so we insert it at slot 4.
Hash Table:
[Empty, Empty, Empty, Empty, 15, Empty, Empty, Empty, Empty, Empty, Empty]
Step 3:
Insert the second key, 47, into the hash table using the hashing function. The hash value for 47 is 3, so we insert it at slot 3.
Hash Table:
[Empty, Empty, Empty, 47, 15, Empty, Empty, Empty, Empty, Empty, Empty]
Step 4:
Insert the third key, 51. As there is a collision at slot 3 (H(51) = 3), we need to resolve it using the collision resolution method. We create a binary tree at slot 3 and insert 51 as the root node.
Hash Table:
[Empty, Empty, Empty, 47, 15, Empty, Empty, Empty, Empty, Empty, Empty]
/
51
Step 5:
Insert the fourth key, 22, into the hash table using the hashing function. The hash value for 22 is 0, so we insert it at slot 0.
Hash Table:
[22, Empty, Empty, 47, 15, Empty, Empty, Empty, Empty, Empty, Empty]
/
Empty Empty
Step 6:
Insert the fifth key, 14, into the hash table using the hashing function. The hash value for 14 is 3, so we insert it into the binary tree at slot 3.
Hash Table:
[22, Empty, Empty, 47, 15, Empty, Empty, Empty, Empty, Empty, Empty]
/
14 51
Step 7:
Insert the sixth key, 58, into the hash table using the hashing function. The hash value for 58 is 4, so we insert it at slot 4.
Hash Table:
[22, Empty, Empty, 47, 15, 58, Empty, Empty, Empty, Empty, Empty]
/
14 51
Step 8:
Insert the seventh key, 80, into the hash table using the hashing function. The hash value for 80 is 7, so we insert it at slot 7.
Hash Table:
[22, Empty, Empty, 47, 15, 58, Empty, 80, Empty, Empty, Empty]
/
14 51
Step 9:
Insert the eighth key, 31, into the hash table using the hashing function. The hash value for 31 is 9, so we insert it at slot 9.
Hash Table:
[22, Empty, Empty, 47, 15, 58, Empty, 80, Empty, 31, Empty]
/
14 51
Step 10:
Insert the ninth key, 18, into the hash table using the hashing function. The hash value for 18 is 7. However, there is a collision at slot 7. We need to insert it into the binary tree at slot 7.
Hash Table:
[22, Empty, Empty, 47, 15, 58, Empty, 80, Empty, 31, Empty]
/
14