In what time can a 2-d tree be constructed?

Category: QuestionsIn what time can a 2-d tree be constructed?
Editor">Editor Staff asked 5 months ago

In what time can a 2-d tree be constructed?
 
(a) O(N)
 
(b) O(N log N)
 
(c) O(N^2)
 
(d) O(M log N)
 
My enquiry is from Trees topic in portion Trees of Data Structures & Algorithms I
 
This question was posed to me during a job interview.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct answer is (b) O(N log N)
 
Easy explanation – A perfectly balanced 2-d tree can be constructed in O(N log N) time. This value is computed mathematically.


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