Insertion sort

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Graphical example

In computer science, insertion sort is a method of sorting data, such as numbers, one item at a time. It is not a very efficient method compared to other algorithms such as quicksort. However, it is a very simple algorithm that is easy to build.

As an example:




after sorting