Sorting is the process of applying some order to a collection of items.

Sorting is the process of applying some order to a collection of items. There are various algorithms for doing this, including "mergesort", "quicksort", and "heapsort".

From the Sorting Algorithms Wikipedia entry:

In computer-science a sorting-algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) that require sorted lists to work correctly; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions:

  1. The output is in non-decreasing order (each element is no smaller than the previous element according to the desired total order);
  2. The output is a permutation (reordering) of the input.

Related terminology:

  • alphabetical sort
  • bubble sort
  • bucket sort
  • heapsort
  • insertion sort
  • mergesort
  • natural sort
  • quicksort
  • radix sort
  • selection sort
  • shellsort
  • stable sort
  • topological sort
  • counting sort
  • Quantum-sort