JavaScript Algorithms and Data Structures by trekhleb
Algorithms and data structures implemented in JavaScript with explanations and links to further readings
About JavaScript Algorithms and Data Structures
From the project's README at github.com/trekhleb/javascript-algorithms. Lightly cleaned for readability; for the full source see the upstream repo.
> UKRAINE IS BEING ATTACKED BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. > - Help Ukraine via: > - Serhiy Prytula Charity Foundation > - Come Back Alive Charity Foundation > - National Bank of Ukraine > - More info on war.ukraine.ua and MFA of Ukraine
[](https://github.com/trekhleb/javascript-algorithms/actions?query=workflow%3ACI+branch%3Amaster) [](https://codecov.io/gh/trekhleb/javascript-algorithms)
This repository contains JavaScript based examples of many popular algorithms and data structures.
Each algorithm and data structure has its own separate README with related explanations and links for further reading (including ones to YouTube videos).
Health score breakdown
6-dimension composite. See methodology for formula and weights.
Adoption signals
Real-world usage data, pulled from each registry. The bigger the numbers, the more battle-tested the project.
| Signal | Value | Source |
|---|---|---|
| GitHub stars | 196k | github.com/trekhleb/javascript-algorithms |
| GitHub forks | 31k | github.com/trekhleb/javascript-algorithms |
| NPM downloads (last month) | 144 | javascript-algorithms |
Release & maintenance
Is this project actively maintained, or about to die? Check the recency of last commit and last release.
| Project age | 8.1 years | since Mar 2018 |
| Last commit | 3 months ago | Feb 18, 2026 |
Self-hosting cost across providers
Detected requirements: 4GB RAM, 40GB disk minimum. Cheapest plan per provider that meets the requirement.
| Provider | Plan | Specs | Monthly | |
|---|---|---|---|---|
| hetzner | CAX11 | 2c · 4GB · 40GB | $4.13 USD | Deploy → |
| vultr | VC2 | 1c · 1GB · 25GB | $5 USD | Deploy → |
| linode | Nanode 1GB | 1c · 1GB · 25GB | $5.12 USD | Deploy → |
| digitalocean | Basic Regular 1GB | 1c · 1GB · 25GB | $6 USD | Deploy → |
What people say on Hacker News
Ready to self-host JavaScript Algorithms and Data Structures?
Spin up a hetzner CAX11 (4GB RAM, 40GB disk) for $4.13/mo and follow the project's official install docs.
Data last refreshed May 7, 2026.
Similar open-source projects
Projects in our directory that replace the same SaaS or share topics with JavaScript Algorithms and Data Structures.