cartesian_tree
Builds a Cartesian tree from a numeric array, preserving min-heap order by value and BST order by index.
Instructions
Build a Cartesian tree from an array (min-heap ordered with BST on indices).
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": "cartesian_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| array | Yes | Input array of numbers |