1. Home
  2. Computer Science MCQs
  3. Algorithms and Data Structures
  4. What is the time-complexity of building a segment-tree…

Added 14 Sep 2025

What is the time-complexity of building a segment-tree array for n elements?

  1. O(n log n)
  2. O(n²)
  3. O(n) Correct answer
  4. O(log n)

Correct answer

C. O(n)

14 views

MCQSEXAM

Explanation

Segment-tree construction is O(n) using bottom-up approach.

Reference

https://cp-algorithms.com/data_structures/segment_tree.html

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Algorithms and Data Structures MCQs

Practise all Algorithms and Data Structures MCQs

Similar MCQs