source/algorithms/heapSort.c
void heapify(int vector[], int vector_size, int root)
{
    int largest = root;
    int left = (2*root+1);
    int right = (2*root+2);

    if (left < vector_size && vector[left] > vector[largest])
    {
        largest = left;
    }

    if (right < vector_size && vector[right] > vector[largest])
    {
        largest = right;
    }

    if (largest != root)
    {
        swap(&vector[root], &vector[largest]);
        heapify(vector, vector_size, largest);
    }
}
//This function changes root element.

This function changes root element.
This function changes root element .
void heapify(int vector[], int vector_size, int root)
{
    int largest = root;
    int left = (2*root+1);
    int right = (2*root+2);
    if (left < vector_size && vector[left] > vector[largest])
    {
        largest = left;
    }
    if (right < vector_size && vector[right] > vector[largest])
    {
        largest = right;
    }
    if (largest != root)
    {
        swap(&vector[root], &vector[largest]);
        heapify(vector, vector_size, largest);
    }
}
void heapify ( int vector [ ] , int vector_size , int root ) { int largest = root ; int left = ( 2 * root + 1 ) ; int right = ( 2 * root + 2 ) ; if ( left < vector_size && vector [ left ] > vector [ largest ] ) { largest = left ; } if ( right < vector_size && vector [ right ] > vector [ largest ] ) { largest = right ; } if ( largest != root ) { swap ( & vector [ root ] , & vector [ largest ] ) ; heapify ( vector , vector_size , largest ) ; } }
This function changes root element.
This function changes root element .