If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the expected number of collisions involving a particular key x is : (a) Less than 1 (b) Less than n (c) Less than m (d) Less than n/2 [expand title="Answer" ](a) Hashing is also a method of sorting key values in a database table in an efficient manner. [/expand] 2.
A technique for direct search is
(a) Binary Search
(b) Linear Search
(c) Tree Search
The searching technique that takes O (1) time to find a data is
(a) Linear Search
(b) Binary Search
(d) Tree Search
The goal of hashing is to produce a search that takes
(a) O(1) time
(b) O(n2 )time
(c) O(log n ) time
(d) O(n log n ) time
Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Note that ‘_’ denotes an empty location in the table.
(a) 8, _, _, _, _, _, 10
(b) 1, 8, 10, _, _, _, 3
(c) 1, _, _, _, _, _,3
(d) 1, 10, 8, _, _, _, 3
A hash table can store a maximum of 10 records, currently there are records in location 1, 3,4,7,8,9,10. The probability of a new record going into location 2, with hash functions resolving collisions by linear probing is
Key value pairs is usually seen in
(a) Hash tables
(c) Both a and b
(d) Skip list
What is the best definition of a collision in a hash table?
(a) Two entries are identical except for their keys
(b) Two entries with different data have the exact same key
(c) Two entries with different keys have the same exact hash value.
(d) wo entries with the exact same key have different hash values.
Which of the following scenarios leads to linear running time for a random search hit in a linear-probing hash table?
(a) All keys hash to same index
(b) All keys hash to different indices
(c) All keys hash to an even-numbered index
(d) All keys hash to different even-numbered indices
Breadth First Search is used in
(a) Binary trees
(d) Both a and c above