Anonymous user
Sorting algorithms/Heapsort: Difference between revisions
→{{header|MATLAB}}: Added a better explanation of the code
(Added a solution for MATLAB) |
(→{{header|MATLAB}}: Added a better explanation of the code) |
||
Line 813:
=={{header|MATLAB}}==
This function definition is an almost exact translation of the pseudo-code into MATLAB, but I have chosen to make the heapify function inline because it is only called once in the pseudo-code. Also, MATLAB uses 1 based array indecies, therefore all of the pseudo-code has been translated to reflect that difference.
<lang MATLAB>function list = heapSort(list)
Line 862:
1 2 3 4 5 6</lang>
=={{header|OCaml}}==
|