Gate2020 cs Q15

0. Consider a double hashing scheme in which the primary hash function h1(k) = k mod 23, and the secondary hash function is h2(k) = 1 + (k mod19) Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key-value k =90 is ________.

  • Option : C
  • Explanation :
    Given Hash Function ⇒ h1(k) = k mod 23
    h2(k) = 1 + (k mod 19)
    Table size = 23
    Key = 90
    h1(k) = 90 mod 23 ≡ 21
    h2(k) = 1 + 90 mod 19 ≡ 1 + 14 = 15
    Double hashing, (h1(k) + i.h2(k)) mod 23
    Asked for probe 1, put i = 1
    (21 + 1. (15)) mod 23
    36 mod 23 = 13
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *