What is the time-complexity of building a segment-tree array for n elements?
-
A
O(n log n)
-
B
O(n²)
-
C
O(n)
Correct answer
-
D
O(log n)
14 views
Explanation
Segment-tree construction is O(n) using bottom-up approach.
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ