You are on page 1of 1

DSA LAB 14 (Hashing) BS F13-Aft, BIT F13

Non Credited Lab


- means no evaluation, just for practice, solution may be shared later
Task 1: Using simple mod function insert 15 elements randomly from 101 to 999 randomly, in the array of
size 37, 59, 97 and count collisions?
Again take another array of 78, divide into 6 bins, i.e. take mod of 6 to divide into 6 bins than again take
mod with 13 and create hash h1*13+h2, again insert 15 elements in same size array and count collisions?
Task 2: Given below is the list of 50 Java keywords, store them into array, sort and apply binary search by
calling 1000000 times search function on random any string from this array and note time. Again implement
a hash function by multiplying & adding Ascii values and insert element into some large array say 2001 or
5001 size. Now apply search same time as in binary search using same hash function and note time?

***************** C O O L **************

Resource Person: Abdul Mateen PUCIT-NC

You might also like