41 41 votes The keys $12, 18, 13, 2, 3, 23, 5$ and $15$ are inserted into an initially empty hash table of length $10$ using open addressing with hash function $h(k) = k \mod 10$ and linear probing. What is the resultant hash table? $\begin{array}{|l|l|} \hline 0 & \\\hline 1 & \\\hline 2 & 2 \\\hline 3 & 23 \\\hline 4 & \\\hline 5 & 15 \\\hline 6 & \\\hline 7 & \\\hline 8 & 18 \\\hline 9 & \\\hline \end{array}$ $\begin{array}{|l|l|} \hline 0 & \\\hline 1 & \\\hline 2 & 12 \\\hline 3 & 13 \\\hline 4 & \\\hline 5 & 5 \\\hline 6 & \\\hline 7 & \\\hline 8 & 18 \\\hline 9 & \\\hline \end{array}$ $\begin{array}{|l|l|} \hline 0 & \\\hline 1 & \\\hline 2 & 12 \\\hline 3 & 13 \\\hline 4 & 2 \\\hline 5 & 3 \\\hline 6 & 23 \\\hline 7 & 5 \\\hline 8 & 18 \\\hline 9 & 15 \\\hline \end{array}$ $\begin{array}{|l|l|} \hline 0 & \\\hline 1 & \\\hline 2 & 2,12 \\\hline 3 & 13,3,23 \\\hline 4 & \\\hline 5 & 5,15 \\\hline 6 & \\\hline 7 & \\\hline 8 & 18 \\\hline 9 & \\\hline \end{array}$ Data Structures gatecse-2009 data-structures hashing normal + – Kathleen 11.8k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments Srken commented Nov 23, 2024 reply Follow flag It's lucky that even after mentioning open addressing also ,they've given clarity by mentioning that it's linear probing. 1 1 replyShare FUTURE IITIAN S commented Aug 10, 2025 reply Follow flag Open addressing (linear probing, quadratic, double hashing) → keys stay in table slots. so option c 0 0 replyShare panipuri commented Jul 25 reply Follow flag i agree, hashing terms are very confusing$\underline{Open \ hasing} = seperate \ chaining \rightarrow$ It's called $\underline{open}$ because the data is allowed to leave the main array and grow out into the open space of your memory using linked lists also, $\underline{Open \ hashing }= \ \underline{closed \ addressing}$, i.e once you enter a slot you are closed there can't be mapped to any other slot $\underline{closed \ hasing} \rightarrow$ It's called $\underline{closed}$ because the data is strictly confined (closed in) to the fixed size of the hash table array. If there's a collision, you have to find an open address somewhere else inside the same array. also, $\underline{closed \ hasing} \rightarrow$ $\underline{Open \ addressing}$ 0 0 replyShare Please log in or register to add a comment.
Best answer 45 45 votes (C) is the correct option ..directly from the definition of linear probing. In linear probing, when a hashed location is already filled, locations are linearly probed until a free one is found. http://courses.cs.washington.edu/courses/cse326/00wi/handouts/lecture16/sld015.htm Bhagirathi answered Sep 25, 2014 • edited Dec 31, 2017 by kenzou Bhagirathi comment Share Follow See 1 comment 1 1 comment reply ryan sequeira commented Jan 27, 2016 i edited by ryan sequeira Jan 31, 2016 reply Follow flag Note: Separate Chaining = Open Hashing/Closed Addressing (i.e. each key has a linked list, hence no probing) Closed Hashing/Open Addressing (single array shared, hence probing required) 15 15 replyShare Please log in or register to add a comment.
17 17 votes Here A & B options are incorrect, this is obvious. We are inserting 8 keys but only 4 are present. Hash is data structure for storing data, we don't loose data in Hash. D is incorrect because it looks like chaining . Using Linear Probing we get hash table of C. In linear probing, when a hashed location is already filled, locations are linearly probed until a free one is found. Akash Kanase answered Nov 22, 2015 Akash Kanase comment Share Follow 0 reply Please log in or register to add a comment.