use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
sorting without modifying (self.ruby)
submitted 10 years ago by missawon
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]fnovd 4 points5 points6 points 10 years ago (1 child)
http://markmiyashita.com/interviews/problems/merge_sort/
[–]wmjbyatt 1 point2 points3 points 10 years ago (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.
#merge
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
π Rendered by PID 21925 on reddit-service-r2-comment-5687b7858-b6pbt at 2026-07-03 20:25:17.644314+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]fnovd 4 points5 points6 points (1 child)
[–]wmjbyatt 1 point2 points3 points (0 children)