UGC-NET Dec 2015 · File Organization & Data Types

MCQ · 2 marks · Problem DBMS-INDX-0005

The hash function used in double hashing is of the form:
  1. A
    $h(k,i)=(h_1(k)+h_2(k)+i) \: mod \: m$
  2. B
    $h(k,i)=(h_1(k)+h_2(k)-i) \: mod \: m$
  3. C
    $h(k,i)=(h_1(k)+i \: h_2(k)) \: mod \: m$
  4. D
    $h(k,i)=(h_1(k)-i \: h_2(k)) \: mod \: m$

Solve it on GATE DA practice →More Storage & Indexing problems

Show the worked solution\[\boxed{h(k,i)=\big(h_1(k)+i\,h_2(k)\big)\bmod m,\quad i=0,1,2,\dots}\]Double hashing starts at \(h_1(k)\) and steps by a key-dependent amount \(h_2(k)\) on each probe \(i\). Different keys therefore follow different probe sequences.(A) and (B) Adding or subtracting \(i\) gives a step of 1, which is linear probing with a shifted start — incorrect.(D) The standard form adds \(i\,h_2(k)\) — incorrect.Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com