Anonymous user
Sorting algorithms/Bubble sort: Difference between revisions
→{{header|C}}
(→{{header|C}}: there is no point in making a local variable const) |
|||
Line 227:
=={{header|C}}==
<lang c>void bubble_sort(int *a, int n) {
int
for (j = t = 0; j <
if (a[j] <= a[j + 1]) continue;
▲ t = a[j]; a[j] = a[j + 1]; a[j + 1] = t;
▲ t = 1;
}
}
|