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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"values": "<values>"
},
"name": "segment_tree"
}
}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} |