What is the worst case efficiency for a path compression algorithm?

Category: QuestionsWhat is the worst case efficiency for a path compression algorithm?
Editor">Editor Staff asked 4 weeks ago

What is the worst case efficiency for a path compression algorithm?
 
(a) O(N)
 
(b) O(log N)
 
(c) O(N log N)
 
(d) O(M log N)
 
My doubt stems from Trees in section Trees of Data Structures & Algorithms I
 
This question was addressed to me in homework.

1 Answers
Editor">Editor Staff answered 4 weeks ago

Right option is (d) O(M log N)
 
Best explanation: The worst case efficiency for a path compression algorithm is mathematically found to be O(M log N).