DSA Write Up Questions
DSA Write Up Questions
Assignment 1- Hashing
1. Consider a hash table of size 11 that uses open addressing with linear probing. Let
h(k) = k mod 11 be the hash function used. A sequence of records with keys 43 36 92
87 11 4 71 13 14 is inserted into an initially empty hash table, the bins of which are
indexed from zero to ten. What is the index of the bin into which the last record is
inserted?
2. Prepare hash table by Inserting following Elements into hash table using extendible
hashing: 16, 4, 6, 22, 24, 10, 31, 7, 9, 20, 26. Bucket Size: 3
3. Insert the following data in the hash table of size 10 using linear probing with
chaining by applying with replacement : 11, 33, 20, 88, 79, 98, 68, 44, 66, 24.
Calculate average number of comparisons required to search given data from hash
table.
4. A company's employee records are stored using a hash table with quadratic probing.
If the table size is 11, and the hash function is h(key) = key % 11, insert employee
IDs: 27, 18, 29, 38, 16, 41 and show the table after insertion.
5. A university wants to store student roll numbers in a hash table to manage student
records efficiently. The roll numbers are: {1201, 1315, 1423, 1517, 1672, 1783,
1905} The hash function used is: h(Roll Number)=Roll Number mod 5 . show the
table after each insertion. Use hashing with & without replacement.