From: Joe User Date: 2009-12-29T23:35:53+09:00 Subject: Re: Creating my own method for sorting an array Robert Klemme wrote: > > "Joe", a hint for your "finding the smallest" rock that you are stuck > on: you need only a single pass on the Array to find the smallest (or > largest) element. Just start with an empty "current smallest", > iterate through the Array (using #each for example) and compare the > "current smallest" with the "current iterated". You know what you > have to do if you find an element that is smaller than the "current > smallest"... You can then remove it from the unsorted Array by using > #delete_at or #delete, append it to the sorted and repeat. > > Kind regards > > robert Thank-you for the clue. Joe :) -- Posted via http://www.ruby-forum.com/.