+1 vote
in Data Structures & Algorithms I by (110k points)
What is the time complexity for maintaining a dynamic set of weighted trees?

(a) O (n)

(b) O (n^2)

(c) O (log n)

(d) O (n!)

This is a very interesting question from Binary Trees in section Binary Trees of Data Structures & Algorithms I

I have been asked this question at a job interview.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
The correct option is (c) O (log n)

The best I can explain: A lot of applications have been implemented using Top tree interface. Maintaining a dynamic set of weighted trees is one such application which can be implemented with O (log n) time complexity.

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.