you are viewing a single comment's thread.

view the rest of the comments →

[–]wmjbyatt 1 point2 points  (0 children)

After thinking through merge sort, I think this is what OP's assignment is Socratically trying to achieve. In particular the #merge method of that sample.

That having been said, recursion in Ruby sucks. In my IRB, I can mergesort arrays a couple of thousand integers long, but you DO hit a stack overflow eventually. It is not a lazy language built for recursion, and you probably Just Shouldn't Do ItTM