UGC-NET Jun 2015 · File Organization & Data Types

MCQ · 2 marks · Problem DBMS-INDX-0008

Consider a hash table of size m=100 and the hash function h(k)=floor (m(kA mod 1)) for $A=\frac{ (\sqrt{5}-1)}{2} = 0.618033$. Compute the location to which the key k=123456 is placed in hash table
  1. A
    77
  2. B
    82
  3. C
    88
  4. D
    89

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

Show the worked solution\[\boxed{h(k)=\big\lfloor m\,(kA \bmod 1)\big\rfloor}\]With the given \(A=0.618033\):\[kA=123456\times0.618033=76299.882048,\qquad kA\bmod1=0.882048.\]\[h(k)=\lfloor100\times0.882048\rfloor=\lfloor88.2048\rfloor=88.\]Answer: C

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