So I was looking up sorting algorithms on wikipedia and found Cocktail Sort to be quite interesting. It's the same as bubble sort, only it makes passes in both directions, essentially cutting the sorting time in a little less than half. So if it took bubble sort 10 seconds, cocktail sort would take about 6 seconds.
My question is, how would cocktail sort be programmed in DM? I'm not familiar with the language being used on the wikipedia page :\
Apr 10 2011, 5:19 am