GATE Solved Paper 2020 - GATE 2020

37. In a balanced binary search tree with n elements, what is the worst case time complexity of reporting all elements in range [a, b]? Assume that the number of reported elements is k.

  • Option : A
  • Explanation :

    To find a number between range [x, y] requires log n comparisons.
    As, K numbers are to be found, K + log n would be time complexity.
Cancel reply
Cancel reply

38. Consider three registers R1, R2, and R3 that store numbers in IEEE−754 single precision floating point format. Assume that R1 and R2 contain the values (in hexadecimal notation) 0x42200000 and 0xC1200000, respectively.
If R3 = R1 / R2, what is the value stored in R3 ?

  • Option : B
  • Explanation :
    R1: 0x42200000
    R2: 0xC1200000

    1. Subtract the exponents i.e. divisor exponent from the dividend exponent.

    2. Divide the mantissa i.e

    3. Sign (opposite sign division result sign is –ve)

    Hence, option (B) is correct answer.
Cancel reply
Cancel reply

39. Consider a schedule of transactions T1 and T2:

T1RA  RC WD WBCommit 
T2 RBWB RD WC  Commit

Here, RX stands for “Read(X)” and WX stands for “Write(X)”. Which one following schedules is conflict equivalent to the above schedule?

  • Option : D
  • Explanation :
    R2(B) is conflicting with W1(B) so, W1(B) should always come after R2(B)
    W2(B) is conflicting with W1(B) similarly, W1(B) should always come after W2(B)
    R2(D) is conflicting with W1(D), so, W1(D) should always come after R2(D)
    R1(C) is conflicting with W2(C) so, W2(C) should always come after R1(C)
    Therefore the transaction will be:
    T1T2
     R(B)
     W(B)
     R(D)
    R(A) 
    R(C) 
    W(D) 
    W(B) 
     W(C)
    Commit 
     Commit
Cancel reply
Cancel reply