ai-agent
Javascript Algorithms
Algorithms and data structures implemented in JavaScript with explanations and links to further readings
196,469 stars31,046 forksJavaScriptUpdated 7/26/2026100% free · open source
What it does
javascript-algorithms provides a collection of JavaScript implementations of various algorithms and data structures, along with explanations and links to further learning resources
Install / run
git clone https://github.com/trekhleb/javascript-algorithms.gitWhen to use it
- •When you need to implement a specific algorithm or data structure in a JavaScript project
- •When you want to learn about different algorithms and data structures and how they can be applied in JavaScript
- •When you need a reference implementation of an algorithm or data structure for testing or comparison purposes
Quick start
- 1Explore the README.md file to get an overview of the available algorithms and data structures
- 2Open the src directory to find the implementation of a specific algorithm, such as src/algorithms/searching/linear-search.js
- 3Run a specific algorithm using Node.js, for example: node src/algorithms/searching/linear-search.js
- 4Check out the docs directory for more detailed documentation and explanations of the algorithms and data structures
- 5Use the provided test cases in the test directory to verify the correctness of the implementations
Ready-to-paste prompt
node src/algorithms/sorting/quick-sort.js --array=[3,6,1,8,2,4] --verbose
Heads up: Make sure you have Node.js installed on your system, as the algorithms are implemented in JavaScript and require a JavaScript runtime environment to run
Saves to your device
Topics
algorithm
algorithms
computer-science
data-structures
interview
interview-preparation
javascript
javascript-algorithms
How Javascript Algorithms works
Codeflow
Free to inspect
Javascript Algorithms is a large JavaScript project (~19k lines across 361 code files). It is a full software project: use it through its install path rather than reading it end to end. Last commit a month ago, MIT license, has a test suite.
Size
Large codebase
~19k lines · 361 code files · ~3 h to skim
Setup
Developer setup
A real software project. Use it via its install path; don't expect to read it all.
Runs on
Node.js
No API keys detected
JavaScript 100%
Where to start reading
- 1README.mdStart here — what it does and how to install it
- 2package.jsonDependencies and the commands it exposes
- 3src/playground/README.mdInside src/ — the main logic begins here
What's in each folder
READMEHas testsDocumentedCI checksMIT licenseUpdated this month
Details
Creator
trekhleb
Language
JavaScript
Category
ai-agent
Published
3/24/2018
Are you the creator of this tool? Claim your listing → and earn 85% of every sale.
Related skills
More ai-agent tools founders pair with this one.
ai-agent★ 276,436
Track GitHub Stars with 996.ICU
Get a popular GitHub star counter for your startup, backed by 276k+ GitHub stars, ideal for founders.
ai-agent★ 264,191
Superpowers
An agentic skills framework & software development methodology that works.
ai-agent★ 244,424
Linux: Open Source Kernel
Get the Linux kernel source tree for custom development, ideal for startup founders in need of a flexible OS foundation with 236k+ GitHub stars
ai-agent★ 210,750
Vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
ai-agent★ 204,069
Improve Code with andrej-karpathy-skills
Get better code behavior with andrej-karpathy-skills, 165k+ GitHub stars, for founders using LLMs.
ai-agent★ 189,101
Simplify Zsh with ohmyzsh
Get a customizable terminal experience with ohmyzsh, perfect for startup founders, backed by 188k+ GitHub stars.