0 votes 0 votes The number of comparisons required to search 48 in hash table with chaining is pos = x % 10. The elements inserted into hashtable is 0, 32, 42, 200, 150, 22, 48, 120, 18, 108, 12, 110, 38, 24 1 2 3 4 Programming in C programming-in-c + – Akriti sood asked Dec 28, 2016 Akriti sood 826 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes The new element is always inserted to the beginning of the list in chaining. So, by the time all the insertions are done, the elements at position 8 should be:- 38 -> 108 -> 18 -> 48 So 4 comparisons Samujjal Das answered Dec 28, 2016 selected Dec 29, 2016 by Akriti sood Samujjal Das comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes The picture shows the Hash Table after insertion of all the elements : Now 48 % 10 = 8, It directly goes to slot 8 and compares with the first element in the list which is the required element. So, number of comparisons is 1. Uzumaki Naruto answered Dec 28, 2016 Uzumaki Naruto comment Share Follow See 1 comment See all 1 1 comment reply vijaycs commented Dec 28, 2016 reply Follow Share isn't 48 % 10 = 8, be considered as one comp ?? 0 votes 0 votes Please log in or register to add a comment.