Quiz: Segment Tree Advantage

Test your understanding

Check Your Understanding

With an array and prefix sums, sumRange is O(1) but update is O(n). Segment tree makes both operations:

  1. A.O(log n) for both
  2. B.O(n) for both
  3. C.O(n log n) for both
  4. D.O(1) for both
Start the roadmap to answer the quizzes and solve the challenges