Final answer:
To determine the contents of the hash table when the sequence 1, 3, 8, 10 is inserted using closed hashing, the correct answer is D. 1, 10, 8, _, _, _, 3.
Step-by-step explanation:
To determine the contents of the hash table when the sequence 1, 3, 8, 10 is inserted using closed hashing, we need to apply the hash function (3x + 4) mod 7. Here's how the sequence is inserted:
- Insert 1: (3 * 1 + 4) mod 7 = 0. Place 1 at index 0 of the hash table. The table now looks like this: 1, _, _, _, _, _, _
- Insert 3: (3 * 3 + 4) mod 7 = 6. Place 3 at index 6 of the hash table, but it's already occupied by 1, so use linear probing and place 3 at the next available index, which is 0. The table now looks like this: 1, _, _, _, _, _, 3
- Insert 8: (3 * 8 + 4) mod 7 = 5. Place 8 at index 5 of the hash table. The table now looks like this: 1, _, _, _, _, 8, 3
- Insert 10: (3 * 10 + 4) mod 7 = 1. Place 10 at index 1 of the hash table. The table now looks like this: 1, 10, _, _, _, 8, 3
So the correct answer is D. 1, 10, 8, _, _, _, 3.