kkkkk53

63 阅读1分钟

HEAPSORT(A,n) 1 BUILD-MAx-HEAP(A,n)2 fori = n downto 2 3 exchange A[1] with A[i] 4 A.heap-size = A.heap-size-1 5 MAx-HeAPIFY(A,1)