What is the depth of any tree if the union operation is performed by height?

Category: QuestionsWhat is the depth of any tree if the union operation is performed by height?
Editor">Editor Staff asked 1 month ago

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 I
 
I had been asked this question in semester exam.

1 Answers
Editor">Editor Staff answered 1 month ago

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