SkillAgentSearch skills...

Smoothsort.js

A JavaScript implementation of Dijkstra's smoothsort algorithm.

Install / Use

/learn @jasondavies/Smoothsort.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Smoothsort.js

This is a JavaScript implementation of Dikstra's smoothsort. If the input is already sorted to some degree, it "smoothly" approaches O(n) running time. It is an in-place algorithm, and only requires O(1) auxiliary storage space.

import smoothsort from "smoothsort";

const sort = smoothsort();
const values = [4, 2, 5, 1, 3];

sort(values);

Credits

The implementation is largely based on the Java code in the Wikipedia article.

View on GitHub
GitHub Stars12
CategoryDevelopment
Updated1mo ago
Forks3

Languages

JavaScript

Security Score

75/100

Audited on Mar 7, 2026

No findings