Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8a6918c

Browse files
Fix bug in handling the length of the array
1 parent 10570a2 commit 8a6918c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

‎1-insertion_sort_list.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include "sort.h"
22

3-
void swapNodes(listint_t **Fnode, listint_t **Snode);
4-
53
/**
64
* insertion_sort_list - Sorts a doubly linked list of integers in
75
* ascending order using the insertion sort algorithm.

‎2-selection_sort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void selection_sort(int *array, size_t size)
1515
if (size < 2)
1616
return;
1717

18-
for (upperFor = 0; upperFor < size-2; upperFor++)
18+
for (upperFor = 0; upperFor < size; upperFor++)
1919
{
2020
lowerInt = array[upperFor];
2121
lowerInt_index = upperFor;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /