ts-ds / ComparisonSortingAlgorithm
Interface: ComparisonSortingAlgorithm
Defined in: sort/algorithms.ts:37
A sorting algorithm that orders any values with a comparator.
Extends
AlgorithmInfo
Properties
complexity
ts
complexity: Complexity;Defined in: sort/algorithms.ts:33
Inherited from
ts
AlgorithmInfo.complexityid
ts
id: string;Defined in: sort/algorithms.ts:26
Short identifier, the same as the key in the sort object.
Inherited from
ts
AlgorithmInfo.idinPlace
ts
inPlace: boolean;Defined in: sort/algorithms.ts:32
Needs only O(1) or O(log n) extra memory.
Inherited from
ts
AlgorithmInfo.inPlacekind
ts
kind: "comparison";Defined in: sort/algorithms.ts:38
name
ts
name: string;Defined in: sort/algorithms.ts:28
English name, e.g. "Quick sort".
Inherited from
ts
AlgorithmInfo.namesort
ts
sort: <T>(array, compareFn?) => void;Defined in: sort/algorithms.ts:39
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
array | T[] |
compareFn? | CompareFn<T> |
Returns
void
stable
ts
stable: boolean;Defined in: sort/algorithms.ts:30
Equal elements keep their original order.
Inherited from
ts
AlgorithmInfo.stable