From: "Jan E." Date: 2012-06-11T07:52:10+09:00 Subject: Re: Beginner question: Bubble sort using array.each_index Michael Sung wrote in post #1063963: > If you have a better way I could accomplish this without using the > previously described algorithm, I would very much appreciate it. It's > something I've been struggling with all night. Well, you can use *any* sorting algorithm. You may also stick to the one above. I didn't say it's wrong, I just said it's inefficient (and not bubble sort). Typical and simple sorting algorithms are insertion sort, selection sort and bubble sort (the actual one). You'll find good explanations at wikipedia: http://en.wikipedia.org/wiki/Category:Sorting_algorithms And if you're looking for implementations, this is a good source: http://en.wikibooks.org/wiki/Algorithm_Implementation/Sorting -- Posted via http://www.ruby-forum.com/.