Sorting algorithms/Cocktail sort: Difference between revisions

m
(→‎version handles non-blanks: Explain the "simpler swap mechanism")
imported>Arakov
Line 1,742:
 
=={{header|Elena}}==
ELENA 56.0x :
<syntaxhighlight lang="elena">import extensions;
import system'math;
Line 1,758:
swapped := false;
for(int i := 0,; i <= list.Length - 2,; i += 1)
{
if (list[i]>list[i+1])
Line 1,772:
swapped := false;
for(int i := list.Length - 2,; i >= 0,; i -= 1)
{
if (list[i]>list[i+1])
Anonymous user