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
For the following graph find the adjacency matrix and adjacency list representation of the graph.

Encryption the plain-text using the round keys: 1. (Key schedule) Implement an algorithm that will take a 128 bit key and generate the round keys for the AES encryption/decryp

Decision Tree A decision tree is a diagram that shows conditions and actions sequentially and therefore shows which condition is to be considered first, second and so on. It is

If a Dequeue is implemented via arrays, then this will suffer with the similar problems which a linear queue had suffered. Program 8 gives the array implementation of Dequeue.

Sorting is significant application activity. Several sorting algorithms are obtainable. But, each is efficient for a specific situation or a specific kind of data. The choice of a

Z-Buffer Algorithm Also known as the Depth-Buffer algorithm, this image-space method simply selects for  display the polygon or portion of a polygon that is nearest to the view

Almost Complete Binary Tree :-A binary tree of depth d is an almost whole binary tree if: 1.Any node and at level less than d-1 has two children. 2. for any node and in the tree wi

What is Efficiency of algorithm? Efficiency of an algorithm can be precisely explained and investigated with mathematical rigor.  There are two types of algorithm efficiency

Algorithm for determining strongly connected components of a Graph: Strongly Connected Components (G) where d[u] = discovery time of the vertex u throughout DFS , f[u] = f

This section prescribes additional exercise with the recursive and iterative handling of a binary search tree. Adding to the Binary Search Tree Recursively Add implementation