Anonymous user
Sorting algorithms/Cocktail sort: Difference between revisions
→{{header|C}}: cleanup
m ({{omit from|GUISS}}) |
(→{{header|C}}: cleanup) |
||
Line 263:
=={{header|C}}==
<lang c>#include <stdio.h>
#define
}▼
void cocktailsort(int *a, unsigned int
{
int i,
while (!t) {
for (i = t = 1; i < len; i++) try_swap;
}
▲}
▲ for(i= l - 2; i >= 0; i--) {
<lang c>int array[10] = { 5, -1, 101, -4, 0,▼
int main()
{
int len = sizeof(x)/sizeof(x[0]);
return 0;
}</lang>
|