javascript-algorithms
by
trekhleb

Description: 📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

View trekhleb/javascript-algorithms on GitHub ↗

Summary Information

Updated 3 minutes ago
Added to GitGenius on May 12th, 2026
Created on March 24th, 2018
Open Issues & Pull Requests: 402 (+0)
Number of forks: 31,067
Total Stargazers: 195,986 (+0)
Total Subscribers: 4,230 (+0)

Issue Activity (beta)

Open issues: 21
New in 7 days: 0
Closed in 7 days: 2
Avg open age: 743 days
Stale 30+ days: 21
Stale 90+ days: 18

Recent activity

Opened in 7 days: 0
Closed in 7 days: 2
Comments in 7 days: 0
Events in 7 days: 3

Top labels

No label distribution available yet.

Most active issues this week

Detailed Description

The trekhleb/javascript-algorithms repository is a comprehensive collection of algorithms and data structures implemented in JavaScript. Its primary purpose is to provide clear, well-documented examples of popular algorithms and data structures, making them accessible to JavaScript developers and learners. Each implementation is accompanied by detailed explanations and links to further readings, including YouTube videos, which help users understand both the theory and practical aspects of the algorithms.

The repository covers a wide range of data structures, from basic ones like linked lists, stacks, queues, hash tables, heaps, and priority queues, to advanced structures such as tries, trees (including binary search trees, AVL trees, red-black trees, segment trees, and Fenwick trees), graphs, disjoint sets, bloom filters, and LRU caches. Each data structure is organized in its own directory with a dedicated README, making it easy to navigate and study specific topics.

Algorithms are similarly categorized and span various domains, including mathematics (bit manipulation, factorial, Fibonacci, prime factors, GCD, LCM, matrix operations, and more), sets (cartesian product, permutations, combinations, knapsack problem, maximum subarray, etc.), strings (palindrome, Hamming distance, Levenshtein distance, substring search algorithms), searching (linear, binary, jump, interpolation), sorting (bubble, selection, insertion, heap, merge, quick, shell, counting, radix, bucket), linked list operations, tree and graph traversals (DFS, BFS), graph algorithms (Kruskal’s, Dijkstra, Bellman-Ford, Floyd-Warshall, Prim’s, cycle detection, topological sorting, articulation points, bridges, Eulerian and Hamiltonian paths, strongly connected components, travelling salesman), cryptography (polynomial hash, rail fence, Caesar, Hill ciphers), machine learning basics (k-NN, k-Means), image processing (seam carving), statistics (weighted random), evolutionary algorithms (genetic algorithm), and uncategorized problems (Tower of Hanoi, matrix rotation, jump game, unique paths, rain terraces, recursive staircase, stock trading, valid parentheses, N-Queens, Knight’s Tour).

The repository also organizes algorithms by paradigm, including brute force, greedy, divide and conquer, dynamic programming, backtracking, and branch & bound. This helps users understand not only how algorithms work but also the underlying strategies used to solve problems efficiently.

For practical use, the repository provides instructions for installing dependencies, running lint checks, and executing tests. It supports Node.js version 16 or higher and includes troubleshooting tips for common issues. The codebase is actively maintained, with continuous integration and code coverage tools ensuring code quality.

A notable feature is the multilingual support, offering README translations in over a dozen languages, which broadens accessibility for a global audience. Overall, trekhleb/javascript-algorithms serves as an educational resource and reference for anyone interested in learning or reviewing algorithms and data structures in JavaScript, whether for academic purposes, interview preparation, or software development.

javascript-algorithms
by
trekhlebtrekhleb/javascript-algorithms

Repository Details

Fetching additional details & charts...