From: "zubair a." Date: 2012-12-08T23:13:37+09:00 Subject: Re: if n belongs to set a and m belongs to set b repeat some steps, How? pls find the attachment, this is a merge sort algo implementation where you can see i have to check values of i and j in while loop assuming they are dividing the array into two halves. actually i was trying to code something like: list=[1,2,3,4,5,6] (0..2,3..5).each do |i,j| do some task using i and j end but ruby is not accepting this code as legal, thanks to @Jan E. , i appreciate your code as it is much closer to what i was trying to do, as ruby is very expressive so code written in ruby should be read as we write pseudo-code :) and yes code that i have attached is still have some error which i yet to remove them all... Attachments: http://www.ruby-forum.com/attachment/7941/MergeSort.rb -- Posted via http://www.ruby-forum.com/.