mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-11 21:36:45 +00:00
[PR #396] Error in heap_sort function while sorting #768
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/396
State: closed
Merged: Yes
Added comments and updated heap_sort function
In heap_sort function after heapifying unsorted array while creating a sorted array (from second for loop)
the last element is not sorted as i is defined as >0 so it should be changed to i>=0.