What is the time complexity for maintaining a dynamic set of weighted trees?

Category: QuestionsWhat is the time complexity for maintaining a dynamic set of weighted trees?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702