TopGit
GitHub Repo Review

JavaScript Algorithms and Data Structures Repo

trekhleb/javascript-algorithms
JTopGit review image for trekhleb/javascript-algorithms
Review by Topgit.dev for trekhleb/javascript-algorithms, with GitHub repository stats and README context.
Quick verdict

JavaScript Algorithms and Data Structures is a GitHub repository walking through common algorithms and data structures in runnable JavaScript, with a short write-up for nearly every entry. Coverage spans dozens of items tagged Beginner or Advanced across data structures, topics, and paradigms. Reach for it as an interview-prep or CS-refresher companion; skip it for a single deeply annotated explanation instead of a wide catalog of short ones.

Stars
โ˜… 196.7k
Forks
โ‘‚ 31.0k
Contributors
๐Ÿ‘ฅ 225
Language
JavaScript
License
MIT
Topic
Automation
Updated
Jul 2026
Homepage
โ€”

An Educational Resource for Core CS Concepts

JavaScript Algorithms and Data Structures is a GitHub repository that gathers JavaScript implementations of well-known algorithms and data structures, according to its own description. Each entry has a dedicated README explaining how it works, often with links to outside reading and some YouTube videos, and the whole set is organized three ways: by data structure, by algorithm topic, and by algorithmic paradigm.

Who Should Use This Repository?

  • โ€ขDevelopers prepping for coding interviews who want runnable JavaScript versions of classic problems such as the Knapsack Problem, Longest Common Subsequence, and the Travelling Salesman Problem, each tagged Beginner or Advanced.
  • โ€ขStudents working through computer science fundamentals who want JavaScript-first material instead of textbook pseudocode.
  • โ€ขJavaScript developers who never formally studied algorithms and want examples grouped by paradigm (Greedy, Backtracking, Dynamic Programming) instead of just an alphabetical list.
  • โ€ขAnyone comparing related techniques side by side, like the three shortest-path algorithms (Dijkstra, Bellman-Ford, Floyd-Warshall) grouped together under Graphs.
  • โ€ขNon-English-speaking developers, since the README links to translations including Chinese, Japanese, Korean, Spanish, and Vietnamese versions, among others.

Strengths

  • โœ“Wide topic coverage: the data-structures list alone runs from basics like Linked List and Stack to Trie, AVL Tree, Red-Black Tree, Segment Tree, and Bloom Filter.
  • โœ“Every entry is labeled Beginner or Advanced, so you can filter by your own level instead of guessing from the name.
  • โœ“Algorithms are cross-referenced two ways, by topic (Math, Strings, Graphs, Cryptography, Machine Learning) and by paradigm (Brute Force, Greedy, Divide and Conquer, Dynamic Programming, Backtracking), which makes it easy to see the same technique reused across different problems.
  • โœ“Every algorithm and data structure gets its own README explaining how it works, with further-reading links and some YouTube videos, instead of just a bare code file.
  • โœ“MIT license, so the code is free to read, copy, and adapt without restriction.

Scope and What's Not Included

  • โ–ณThis is a study resource, not an npm package; nothing here is published for import into a production project.
  • โ–ณThe Branch & Bound paradigm section explains the technique in prose but lists no code examples under it, unlike every other paradigm section.
  • โ–ณThe Machine Learning section links out to two of the author's other repositories, NanoNeuron and self-parking-car-evolution, rather than including those implementations directly.
  • โ–ณNo version number or changelog appears in the README, so there's no documented way to tell how recently a given example was last touched.
  • โ–ณExplanations sit in a separate README per folder rather than as inline code comments, so understanding one algorithm usually means opening two files, not one.

Common Questions

What programming language are the examples written in?

JavaScript Algorithms and Data Structures implements every example in JavaScript, matching the repo's own language tag and description.

Does each algorithm and data structure have explanations?

JavaScript Algorithms and Data Structures gives each algorithm and data structure its own separate README with an explanation and further-reading links, including some YouTube videos, according to the repo.

What license applies to this repository?

JavaScript Algorithms and Data Structures is released under the MIT license, per its GitHub license field.

How do I run the code examples and tests?

The README documents npm install to pull dependencies, npm test to run the full suite, and commands like npm test -- 'LinkedList' to run tests by name; it also points to a playground file at ./src/playground/playground.js for experimenting.

Are there beginner-friendly examples available?

JavaScript Algorithms and Data Structures flags every entry Beginner (B) or Advanced (A) right in its list, and a large share, including Bubble Sort, Binary Search, Stack, and Linked List, are marked Beginner.

Is the content available in multiple languages?

JavaScript Algorithms and Data Structures links to translated README versions, including simplified and traditional Chinese, Japanese, Korean, Spanish, Portuguese, Russian, French, German, and Vietnamese, among others, per the repo.

Key features

  • โœ“Data structures span the basics (Linked List, Doubly Linked List, Queue, Stack, Deque, Hash Table, Heap, Priority Queue) through advanced ones like Trie, AVL Tree, Red-Black Tree, Segment Tree, Fenwick Tree, Graph, Disjoint Set, Bloom Filter, and LRU Cache.
  • โœ“Algorithms are grouped by topic: Math, Sets, Strings, Searches, Sorting, Linked Lists, Trees, Graphs, Cryptography, Machine Learning, Image Processing, Statistics, Evolutionary algorithms, and an Uncategorized catch-all.
  • โœ“Algorithms are also grouped by paradigm (Brute Force, Greedy, Divide and Conquer, Dynamic Programming, Backtracking, and Branch & Bound), so you can study the same underlying technique across different problems.
  • โœ“Graph algorithms alone cover Dijkstra, Bellman-Ford, and Floyd-Warshall for shortest paths, plus Kruskal's and Prim's for minimum spanning trees, Tarjan's algorithm for articulation points, and Kosaraju's algorithm for strongly connected components.
  • โœ“String algorithms include Levenshtein Distance, Knuth-Morris-Pratt, the Z Algorithm, and Rabin-Karp for pattern matching, alongside simpler entries like Hamming Distance and Palindrome checks.
  • โœ“A small Machine Learning section covers k-NN and k-Means directly in the repo, plus links out to the author's separate NanoNeuron and self-parking-car-evolution projects for neural networks and genetic algorithms.
  • โœ“Every entry is tagged Beginner (B) or Advanced (A).
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

Alternatives

Who should try it โ€” and who should skip

Try JavaScript Algorithms and Data Structures if you're a JavaScript developer prepping for interviews or filling in CS fundamentals you never studied formally; the Beginner/Advanced tags and topic/paradigm cross-referencing make it easy to build a study path. Skip it if you want a single deep explanation of one algorithm rather than a broad catalog, or if you need implementations in a language other than JavaScript; the README points to translated docs but not translated code.

Related repositories

Source & attribution

Facts and quotes sourced from the trekhleb/javascript-algorithms GitHub repository and its README.

GitHub data ยท last synced Aug 14, 2026Reviewed by Henry
โ† Back to TopGit

Still deciding about javascript-algorithms?

One click hands the question to an AI along with this page โ€” see what it says about javascript-algorithms.

GitHub