Sorting algorithms/Cocktail sort: Difference between revisions

Content added Content deleted
(Alternative C solution)
m (Bug fix)
Line 555: Line 555:
}
}
if (swapped) {
if (swapped) {
swapped = false;
for (char* p = end; p > begin; p -= size) {
for (char* p = end; p > begin; p -= size) {
char* q = p - size;
char* q = p - size;