1. Computing

Discuss in my forum

Michael Morin

Sorting Arrays

By , About.com GuideAugust 29, 2012

Follow me on:

Quick, how do you sort an array?  How you answer this depends on where you're coming from.  If you're a C programmer, you might go on about the merits of quicksort or mergesort.  If you're from C++, the standard template library has facilities for this.  But this is Ruby, how do you do it?  Well, you call the sort method, but there's slightly more to it than that.  Being a high level language, Ruby has isolated you from the sorting algorithm itself, but given you very easy sorting and a very easy way to change its behavior.

Comments
No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2013 About.com. All rights reserved.