1.

What is the depth of any tree if the union operation is performed by height?(a) O(N)(b) O(log N)(c) O(N log N)(d) O(M log N)My doubt is from Trees topic in division Trees of Data Structures & Algorithms II had been asked this question in semester exam.

Answer»

Correct choice is (B) O(LOG N)

For EXPLANATION: If the Unions are PERFORMED by HEIGHT, the depth of any tree is calculated to be O(log N).



Discussion

No Comment Found

Related InterviewSolutions