heap_sort
Sort an array of numbers in place using the heap sort algorithm, guaranteeing O(n log n) time and returning the swap count.
Instructions
Sort numbers using the heap sort algorithm. Guaranteed O(n log n) in-place sorting with swap count.
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": "heap_sort"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| array | Yes | Array of numbers to sort |