A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each node x. If the cost of computing g(x) is min{no. of leaf-nodes in left-subtree of x, no. of leaf-nodes in right-subtree of x} then the worst-case time complexity of the program is
Θ(n)
Θ(nLogn)
Θ(n2)
Θ(n2log n)
This question is part of this quiz :
Top MCQs on Balanced Binary Search Trees with Answers,GATE-CS-2004,Algorithms GATE CS PYQ Quiz,Complexity Analysis GATE CS PYQ Quiz