Difference between revisions of "sorting algorithm"

From Lazarus 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...")
 
 
(3 intermediate revisions by 2 users not shown)
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 ==
 +
Generic algorithms include
 +
<!-- ordered by complexity -->
 +
* [[Smoothsort]], <!-- O(n log(n)) -->
 +
* [[Radix sort]], <!-- O(l⋅n) -->
 +
* [[Shell sort]], and
 +
* [[Bubble sort]]. <!-- O(n²) -->
 +
 
 +
== Targeted Implementation ==
 +
Some sorting algorithms are tweaked based on properties the provided objects have or other information about the set of objects.
 +
The 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

Latest revision as of 19:16, 30 January 2021

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

Generic algorithms include

Targeted Implementation

Some sorting algorithms are tweaked based on properties the provided objects have or other information about the set of objects. The 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