[PR #396] Error in heap_sort function while sorting #768

Closed
opened 2026-01-29 15:15:06 +00:00 by claunia · 0 comments
Owner

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.

**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.
claunia added the pull-request label 2026-01-29 15:15:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#768