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 1 month 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 1 month 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.