Question DSA-TREE-0076
HardA segment tree over n elements answers range-sum queries in O(log n). How many nodes does it have?
- A.
About 2n (at most 4n with array storage)
- B.
log n
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Trees question
A segment tree over n elements answers range-sum queries in O(log n). How many nodes does it have?
About 2n (at most 4n with array storage)
log n
Sign up free to see the answer and a step-by-step explanation.
n
n²