+1 vote
in Data Structures & Algorithms I by (110k points)
What is the worst-case running time of unions done by size and path compression?

(a) O(N)

(b) O(logN)

(c) O(N logN)

(d) O(M logN)

My question is based upon Trees topic in section Trees of Data Structures & Algorithms I

The question was asked by my school teacher while I was bunking the class.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Right choice is (d) O(M logN)

For explanation: The worst case running time of a union operation done by size and path compression is mathematically found to be  O(M logN).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...