Difference between revisions of "sorting algorithm"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "{{sorting algorithm}} The sorting algorithm puts the elements in order. There are several different sorting algorithms. Some are made for special purposes where they are good...")
 
(structure page, rephrase definition of lemma)
Line 1: Line 1:
 
{{sorting algorithm}}
 
{{sorting algorithm}}
  
The sorting algorithm puts the elements in order.
+
A '''sorting algorithm''' is a finite sequence of steps required to put a series of sortable objects into a sorted order.
There are several different sorting algorithms. Some are made for special purposes where they are good. When choosing a sorting algorithm, you should know what purpose it is selected for and under what operating conditions it is used. Some sorting algorithms include, for example, [[Bubble sort]], [[Radix sort]], [[Counting sort]], and [[Smoothsort]].
+
 
 +
__NOTOC__
 +
 
 +
== generic methods ==
 +
There are several different sorting algorithms.
 +
Some sorting algorithms include, for example,
 +
<!-- ordered by complexity -->
 +
* [[Smoothsort]], <!-- O(n log(n)) -->
 +
* [[Radix sort]], and <!-- O(l⋅n) -->
 +
* [[Bubble sort]]. <!-- O(n²) -->
 +
 
 +
== targeted implementation ==
 +
Some sorting algorithms are tweaked based on the properties the provided objects have or other information about the set of objects.
 +
Following sorting algorithms are made for special purposes:
 +
* [[Array sort]] (arrays of comparable objects)
 +
* [[Counting sort]] (integers)
 +
* [[NaturalSort]] (strings)
 +
 
 +
== choosing a sorting algorithm ==
 +
When choosing a sorting algorithm, you should know what purpose it is selected for and under what operating conditions it is used.
 +
 
 +
== see also ==
 +
* [[FGL]] – the Free Generics Libray – provides templates for collections that can be sorted, without re-inventing the wheel

Revision as of 07:31, 24 June 2020

English (en)

A sorting algorithm is a finite sequence of steps required to put a series of sortable objects into a sorted order.


generic methods

There are several different sorting algorithms. Some sorting algorithms include, for example,

targeted implementation

Some sorting algorithms are tweaked based on the properties the provided objects have or other information about the set of objects. Following sorting algorithms are made for special purposes:

choosing a sorting algorithm

When choosing a sorting algorithm, you should know what purpose it is selected for and under what operating conditions it is used.

see also

  • FGL – the Free Generics Libray – provides templates for collections that can be sorted, without re-inventing the wheel