Hash table, Data Structure & Algorithms

Q. Make the 11 item hash table resulting from hashing the given keys: 12, 44, 13, 88, 23, 94, 11, 39, 20, 16 and 5 by making use of the hash function h(i) = (2i+5) mod 11.     

Ans.

The size of the table is  11

h(12) = (24+5) mod 11 = 29 mod 11 = 7

h(44) = (88+5) mod 11 = 93 mod 11 = 5

h(13) = (26+5) mod 11 = 31 mod 11 = 9

h(88) = (176+5)mod 11= 181mod 11 = 5

h(23) = (46+5) mod 11 = 51 mod 11 = 7

h(94) = (188+5)mod 11= 193mod 11 = 6

h(11) = (22+5) mod 11 = 27 mod 11 = 5

h(39) = (78+5) mod 11 = 83 mod 11 = 6

h(20) = (40+5) mod 11 = 45 mod 11 = 1

h(16) = (24+5) mod 11 = 29 mod 11 = 4

h(5) = (10+5) mod 11 = 15 mod 11 = 4

1648_hash table.png

Posted Date: 7/12/2012 8:37:30 AM | Location : United States







Related Discussions:- Hash table, Assignment Help, Ask Question on Hash table, Get Answer, Expert's Help, Hash table Discussions

Write discussion on Hash table
Your posts are moderated
Related Questions
What are the properties of an algorithsm?

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

How to creat ATM project by using double linked list?

how to write a code for for a company , for calculate the salary pay

(1) Sort a list of distinct numbers in ascending order, using the following divide- and-conquer strategy (Quicksort): divide the list of numbers into two lists: one that contains a

A striking application of DFS is determine a strongly connected component of a graph. Definition: For graph G = (V, E) , where V refer to the set of vertices and E refer to the

First - Fit Method: -    The free list is traversed sequentially to search the 1st free block whose size is larger than or equal to the amount requested. Once the block is found it

You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring marker on it. There is a tap that can be used to fill the jugs with water. How can you get exac

The complexity of searching an element from a set of n elements using Binary search algorithm is   O(log n)

Inorder traversal: The left sub tree is visited, then the node and then right sub-tree. Algorithm for inorder traversal is following: traverse left sub-tree visit node