wavelet_tree
Builds a wavelet tree from an integer array and answers range kth-smallest queries, enabling order-statistic lookups over subarrays.
Instructions
Build a wavelet tree for an integer array and answer range kth-smallest queries.
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": {
"array": "<array>"
},
"name": "wavelet_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| array | Yes | Array of integers (max 100,000) | |
| queries | No | Queries: {type:'kth', l, r, k} for kth smallest in [l, r) |