What is the time complexity for the initialization of top tree?

Category: QuestionsWhat is the time complexity for the initialization of top tree?
Editor">Editor Staff asked 5 months ago

What is the time complexity for the initialization of top tree?
 
(a) O (n)
 
(b) O (n^2)
 
(c) O (log n)
 
(d) O (n!)
 
Question is taken from Binary Trees in section Binary Trees of Data Structures & Algorithms I
 
The question was asked during an interview for a job.

1 Answers
Editor">Editor Staff answered 5 months ago

Right answer is (a) O (n)
 
Best explanation: Generally, trees have weight on its edges. Also there is one to one correspondence of the edges with the top trees. Therefore, top trees can be initialized in O (n) time.


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