Segment Tree is a binary tree data structure for efficient range queries and updates on arrays.
Key Characteristics:
Applications: Range sum queries, range minimum/maximum queries, and computational geometry.
| Operation | Time Complexity | Space Complexity |
|---|---|---|
| Build | O(n) | O(n) |
| Range Query | O(log n) | O(1) |
| Update | O(log n) | O(1) |
| Space | - | O(n) |
n = number of array elements
Strengths:
Limitations: