template void HeapSort(T a[], int n) {// Sort a[1:n] using the heap sort method. MaxHeap H(1); H.Initialize(a,n,n); T x; for (int i = n-1; i >= 1; i--) { H.DeleteMax(x); a[i+1] = x; } H.Deactivate(); }