segment_tree
Builds a segment tree for sum, min, or max range queries with point updates on a mutable numeric array. Use it to answer repeated range queries and apply index-based updates efficiently.
Instructions
Build a segment tree for range queries (sum/min/max) with point updates on a mutable array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | Yes | Initial array of numbers | |
| operation | No | Aggregate operation (default sum) | |
| operations | No | Operations: {type:'update',index,value} or {type:'query',left,right} |