Difference between revisions of "sorting algorithm"

From Lazarus wiki
Jump to navigationJump to search
(→‎generic methods: adding link to shellsort algorithm)
(Improving language and grammar)
Line 5: Line 5:
 
__NOTOC__
 
__NOTOC__
  
== generic methods ==
+
== Generic Methods ==
There are several different sorting algorithms.
+
Generic algorithms include
Some sorting algorithms include, for example,
 
 
<!-- ordered by complexity -->
 
<!-- ordered by complexity -->
 
* [[Smoothsort]], <!-- O(n log(n)) -->
 
* [[Smoothsort]], <!-- O(n log(n)) -->
Line 14: Line 13:
 
* [[Bubble sort]]. <!-- O(n²) -->
 
* [[Bubble sort]]. <!-- O(n²) -->
  
== targeted implementation ==
+
== Targeted Implementation ==
Some sorting algorithms are tweaked based on the properties the provided objects have or other information about the set of objects.
+
Some sorting algorithms are tweaked based on properties the provided objects have or other information about the set of objects.
Following sorting algorithms are made for special purposes:
+
The following sorting algorithms are made for special purposes:
 
* [[Array sort]] (arrays of comparable objects)
 
* [[Array sort]] (arrays of comparable objects)
 
* [[Counting sort]] (integers)
 
* [[Counting sort]] (integers)
 
* [[NaturalSort]] (strings)
 
* [[NaturalSort]] (strings)
  
== choosing a sorting algorithm ==
+
== 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.
 
When choosing a sorting algorithm, you should know what purpose it is selected for and under what operating conditions it is used.
  
 
== see also ==
 
== see also ==
 
* [[FGL]] – the Free Generics Libray – provides templates for collections that can be sorted, without re-inventing the wheel
 
* [[FGL]] – the Free Generics Libray – provides templates for collections that can be sorted, without re-inventing the wheel

Revision as of 19:14, 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