From: Armin Roehrl Date: 2003-12-04T19:19:48+09:00 Subject: Re: sorting > >swap(x,y) >z = x >x = y >y = z >end > > > Ruby can do easier swaps: x,y=3,4 x,y=y,x #-> x==4 and y==3 Here is quicksort (Tony Hoare). def quicksort( xs ) return xs if xs.size <= 1 m = xs[0] # Split-Element quicksort(xs.select { |i| i < m } ) + xs.select { |i| i == m } + quicksort(xs.select { |i| i > m } ) end quicksort([13, 11, 74, 69, 0]) #-> [0, 11, 13, 69, 74] I quick search on the web also showed up this link: http://yagni.com/combsort/index.php (Bubblesort, Combsort) If you search for insertion sort, etc. you find many other sorting algorithms. Have fun, -A.