Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created July 8, 2020 12:22
Show Gist options
  • Save BMU-Verlag/adac6175f54e2e5274d306c3a6770980 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/adac6175f54e2e5274d306c3a6770980 to your computer and use it in GitHub Desktop.
void heapSort(int arr[], int groesse) {
for (int i = groesse / 2 - 1; i >= 0; i--){
heapify(arr, groesse, i);
}
for (int i = groesse - 1; i >= 0; i--){
int tausch = arr[i];
arr[i] = arr[0];
arr[0] = tausch;
heapify(arr, i, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment