There was an error while loading. Please reload this page.
1 parent ea50acb commit 41f0292Copy full SHA for 41f0292
1 file changed
sorting/InsertionSort.c
@@ -21,13 +21,13 @@ int main()
21
{
22
// You'll enter the loop if the elmtToInsert is less than the element just before it.
23
24
- arraySort[j+1] = arraySort[j]; /*shift the current element one place forward to create room for insertion of the
25
- elmtToInsert when the correct position is found */
+ arraySort[j+1] = arraySort[j]; //shift the current element one place forward to create room for insertion of the elmtToInsert
26
j--;
27
}
28
//when we exit the loop, j+1 will be the index of the correct position of the elmtToInsert
29
30
arraySort[j+1] = elmtToInsert ; //'insert' the elmtToInsert into its correct position
+
31
32
33
0 commit comments