Understanding the insertion sort algorithm in Ruby
There are lots of ways to sort data. Insertion sort is particularly interesting because it sorts the data in place and is pretty easy to understand. While most of us just use the #sort method, interviewers still love to ask questions about sorting algorithms and related topics like Big-O notation. In this post, you'll learn not only how insertion sort works but also how to implement it yourself in Ruby.