6 remove unneded variable

This commit is contained in:
NaiJi ✨ 2024-04-22 09:50:15 +04:00
parent fe9e21048f
commit 734fea77a6
1 changed files with 1 additions and 3 deletions

View File

@ -22,10 +22,9 @@
void bubble_sort(int array[], int size) void bubble_sort(int array[], int size)
{ {
int shift = 0;
for (int i = 1; i < size; ++i) for (int i = 1; i < size; ++i)
{ {
for (int j = 1; j < size - shift; ++j) for (int j = 1; j < size - i; ++j)
{ {
if (array[j] < array[j-1]) if (array[j] < array[j-1])
{ {
@ -34,7 +33,6 @@ void bubble_sort(int array[], int size)
array[j-1] = temp; array[j-1] = temp;
} }
} }
++shift;
} }
} }