UGC NET COMPUTER SCIENCE SOLVED PAPERS 2014-16 - UGC NET Computer Science Paper 3 August 2016

32. Consider a hash table of size m = 10000, and the hash function h(K) = floor (m(KA mod 1)) for A = ( √(5) – 1)/2. The key 123456 is mapped to location ______.

  • Option : B
  • Explanation :
    Given hash function: h(K) = floor (m (K*A mod 1)) where A = ( √(5) – 1)/2
    h(123456) = floor(10000 * (123456 * (√5 − 1) / 2) mod 1)
    = floor(10000 * (76300.004115 mod 1)
    = floor(10000 * (.004115))
    = 41.15
    = 41
    So, option (B) is correct.
Cancel reply
Cancel reply

35. If there are n integers to sort, each integer has d digits, and each digit is in the set {1, 2, ..., k}, radix sort can sort the numbers in:

  • Option : B
  • Explanation :
    If there are n integers to sort, each integer has d digits, and each digit is in the set {1, 2, ..., k}, radix sort can sort the numbers in O(d (n + k)). For more information Refer:Radix Sort Option (B) is correct.
Cancel reply
Cancel reply