Solve hash table problem
Step 1: Insert key 12
The hash function is $h(k) = (3k + 5) \pmod{11}$. For key 12, the initial index is $h(12) = (3 \times 12 + 5) \pmod{11} = (36 + 5) \pmod{11} = 41 \pmod{11}$. Since $41 = 3 \times 11 + 8$, $41 \pmod{11} = 8$. Index 8 is empty, so 12 is placed at index 8.
Step 2: Insert key 23
For key 23, the initial index is $h(23) = (3 \times 23 + 5) \pmod{11} = (69 + 5) \pmod{11} = 74 \pmod{11}$. Since $74 = 6 \times 11 + 8$, $74 \pmod{11} = 8$. Index 8 is occupied by 12. Using linear probing, we check the next index: $(8 + 1) \pmod{11} = 9$. Index 9 is empty, so 23 is placed at index 9.
Step 3: Insert key 1
For key 1, the initial index is $h(1) = (3 \times 1 + 5) \pmod{11} = (3 + 5) \pmod{11} = 8 \pmod{11} = 8$. Index 8 is occupied by 12. Using linear probing, we check the next index: $(8 + 1) \pmod{11} = 9$. Index 9 is occupied by 23. Using linear probing, we check the next index: $(9 + 1) \pmod{11} = 10$. Index 10 is empty, so 1 is placed at index 10.
Step 4: Insert key 34
For key 34, the initial index is $h(34) = (3 \times 34 + 5) \pmod{11} = (102 + 5) \pmod{11} = 107 \pmod{11}$. Since $107 = 9 \times 11 + 8$, $107 \pmod{11} = 8$. Index 8 is occupied by 12. Using linear probing, we check the next index: $(8 + 1) \pmod{11} = 9$. Index 9 is occupied by 23. Using linear probing, we check the next index: $(9 + 1) \pmod{11} = 10$. Index 10 is occupied by 1. Using linear probing, we check the next index: $(10 + 1) \pmod{11} = 0$. Index 0 is empty, so 34 is placed at index 0.
Answer: The key 34 is at index 0.