PA of Algorithms Q67

0. Suppose we have a balanced binary search tree T holding n-numbers. We are given two numbers L and H and wish to sum up all the numbers in T that lie between L and H. Suppose there are m such numbers in T.
If the tightest upper bound on the time to compute the sum is O(na logbn + mc logdn), the value of α + 10b + 100c + 1000d is ____.

  • Option : A
  • Explanation :
    The time complexity is O (m + logn)
    So C = 1, d = 0, a = 0, b = 1
    0 + 10 × 1 + 100 × 1 + 1000 × 0 = [110]
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 *