1. >Algorithms
Found 2  QuestionsSET DEFAULT
Selected Filters
    Algorithms Hashing
Subjects
Topics

List of top Algorithms Questions on Hashing

Suppose we are given \(n\) keys, \(m\) hash table slots, and two simple uniform hash functions \(h_1\) and \(h_2\). Further suppose our hashing scheme uses \(h_1\) for the odd keys and \(h_2\) for the even keys. What is the expected number of keys in a slot?
  • GATE CS - 2022
  • GATE CS
  • Algorithms
  • Hashing

Consider a dynamic hashing approach for 4-bit integer keys: 

  1. There is a main hash table of size 4.
  2. The 2 least significant bits of a key are used to index into the main hash table.
  3. Initially, the main hash table entries are empty.
  4. To resolve collisions, the set of keys corresponding to a main hash table entry is organized as a binary tree that grows on demand.
  5. First, the 3rd least significant bit is used to divide the keys into left and right subtrees.
  6. Further collisions are resolved by subdividing based on the 4th least significant bit.
  7. A split is done only if needed, i.e., only when there is a collision.

Consider the following state of the hash table. Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?

  • GATE CS - 2021
  • GATE CS
  • Algorithms
  • Hashing