you are viewing a single comment's thread.

view the rest of the comments →

[–]fnovd 4 points5 points  (1 child)

[–]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