Пример #1
0
//Ordena un arreglo, utilizando un Heap como TAD auxiliar
void HeapSort(int A[], int n){
    Heap H;
    int i, k, e;
    for(i=0; i<n; i++){
        H.agregar(A[i],A[i]);
    }
    k=0;
    while( ! H.vacio()){
        e = H.extraer();
        A[k++] = e;
    }
}