// the find
loiane/javascript-datastructures-algorithms
:books: collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
This is the companion source code for Loiane Groner's book 'Learning JavaScript Data Structures and Algorithms'. Every chapter ships both a .js and .ts version of each implementation, plus Jest tests for the data structures. It's squarely aimed at people reading the book or learning DSA fundamentals in JavaScript.
The dual JS/TS approach is genuinely useful — you can see exactly what TypeScript adds without having to mentally translate. Test coverage is solid for the core structures (linked lists, trees, heaps, hash tables), giving learners something to run and break. The graph chapter is more complete than most educational repos: BFS, DFS, Dijkstra, Floyd-Warshall, Prim, and Kruskal are all present with working implementations. The project structure maps 1:1 to book chapters, so it's easy to navigate if you're following along.
The Trie implementation is only in .js with no TypeScript version — inconsistent with the rest of the repo and an odd gap for one of the more interesting structures. There's no complexity analysis in the code or tests, so a learner who wants to verify Big-O claims has to trust the book. The red-black tree is included but has no tests, which is the one structure where subtle bugs are hardest to spot by inspection. This is reference code, not a library — don't expect to import any of it; the implementations aren't designed for reuse.