Gate2020 cs Q56

0. 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

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


Cancel reply

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