Sorting algorithm

A sorting algorithm is an algorithm for computers to sort a list of data, possibly unsorted. More formally, sorting algorithms find the sorted permutation of any given input, therefore a valid sorting algorithm must return a list that is in either non-decreasing or non-increasing order containing all the same items matching that of the initial input.

The task in sorting a list is deceptively simple, and many instinctive techniques one uses in their everyday life, such as Selection sort or Insertion sort, prove inefficient in managing large amounts of data often present in digital databases today. As a result, a large part of computer science, in the 1950's, is dedicated to finding solutions to sort efficiently.