Talk:Sorting algorithms/Cocktail sort

From Rosetta Code
Revision as of 08:20, 28 June 2015 by rosettacode>Craigd (→‎Typos?: Uhhh)

Citation

This page was cited in the Journal of Statistical Software: http://www.jstatsoft.org/v46/i03 . Neat. —Underscore (Talk) 03:37, 2 August 2012 (UTC)

Typos?

@.13='stength ◄─── XI' @.17='the devel ◄─── XV' strength and devil ? --Walterpachl 08:14, 4 July 2012 (UTC)

Thanks, corrected. -- Gerard Schildberger 09:10, 4 July 2012 (UTC)

Uhhhhh

I think the stated algorithm has a bug. Try sorting (2,1). The fix is to change the first for each to "0 to length(A) - 1", not -2. Note that animation in the Wikipedia article doesn't match the algorithm either. --craigd