+1 vote
in Data Structures & Algorithms I by (88.2k points)
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 Answer

+1 vote
by (672k points)
selected by
Best answer
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.

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.