Skip to content

ts-ds / sortingAlgorithms

Variable: sortingAlgorithms ​

ts
const sortingAlgorithms: readonly SortingAlgorithm[];

Defined in: sort/algorithms.ts:62

Every sorting algorithm of the library with its properties, from the simplest to the most advanced. Useful for tables, comparisons and visualizations.

The properties are verified by the test suite: stable algorithms are checked for stability, comparison counts of quick sort are checked against O(n log n).

Example ​

ts
for (const algorithm of sortingAlgorithms) {
  console.log(algorithm.name, algorithm.complexity.average, algorithm.stable);
}

MIT License