Skip to content

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.complexity

id ​

ts
id: string;

Defined in: sort/algorithms.ts:26

Short identifier, the same as the key in the sort object.

Inherited from ​

ts
AlgorithmInfo.id

inPlace ​

ts
inPlace: boolean;

Defined in: sort/algorithms.ts:32

Needs only O(1) or O(log n) extra memory.

Inherited from ​

ts
AlgorithmInfo.inPlace

kind ​

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.name

sort ​

ts
sort: <T>(array, compareFn?) => void;

Defined in: sort/algorithms.ts:39

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
arrayT[]
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

MIT License