Open-source project
mlarocca/AlgorithmsAndDataStructuresInAction avatar
mlarocca/AlgorithmsAndDataStructuresInAction

AlgorithmsAndDataStructuresInAction is the Manning book as runnable code

Advanced Data Structures Implementation

601 stars128 forksJupyter NotebookAGPL-3.0

At a glance

What is it?
mlarocca's repository holds the data structures and algorithms from the Manning book Advanced Algorithms and Data Structures, implemented in Java, JavaScript and Python, with Jupyter notebooks for profiling. It is a teaching companion rather than a library, the implementations are not a package, and the last push was on 2026-06-22.
Who is it for?
Adopt this repository if you are reading the Manning book Advanced Algorithms and Data Structures and want the same structures in Java, JavaScript or Python rather than in the book's pseudo-code, or if you want a worked reference implementation to read. Skip it if you need a maintained, packaged library, because nothing here is published as a dependency and the top level is three language directories rather than a build.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 123 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The repository is the book's code, not a library

This repository contains a collection of data structures and algorithms from the Manning book Advanced Algorithms and Data Structures, formerly titled Algorithms and Data Structures in Action. The relationship to the book is the whole point, and the README explains the split. The book explains these structures using pseudo-code, because the authors wanted to highlight the logic of the algorithms rather than focus on implementation details intrinsic to any programming language. At the same time, hands-on learning is part of the teaching process, so the implementations of those same algorithms are gathered here using a few different programming languages. The top level of the repository shows the shape of that: Java/, JavaScript/ and Python/ directories alongside the README, the licence and a readme/ directory holding the images the documentation uses. There is no package manifest, no build configuration and no release process in the listing. This is reference code published so that a reader can run the thing rather than depend on it.

The same structure in three languages, unevenly covered

Each entry in the README lists a chapter link, the available implementations, and sometimes a profiling notebook, and the pattern of coverage is irregular in a way that matters. The D-ary heap in chapter 2 is the most complete, with Java, JavaScript, Python and a Jupyter notebook for profiling. Huffman Compression in the same chapter has Java and Python but no JavaScript link and no notebook. The Treap in chapter 3 lists Java and a Python profiling notebook but no JavaScript. The Bloom Filter in chapter 4 is JavaScript only, and the Disjoint Set in chapter 5 is JavaScript only as well. The Trie in chapter 6 links Java and JavaScript. So the languages are not interchangeable, and there is no promise that a structure you want exists in the language you want. That is a direct consequence of it being teaching code written alongside a book, and it is the first thing to check before planning around any of it. The profiling notebooks are the most interesting artifacts for a working engineer, because they show the behaviour of the implementations rather than just the algorithm.

What the structures actually are

The README gives short explanations of each one, and they are worth reading because the framing is about the trade-off rather than the mechanism. A heap is conceptually a tree, but it is implemented using an array for the sake of efficiency, and while regular heaps are binary balanced trees, d-ary heaps use d-ary trees to reduce the tree's height, so depending on which operations are performed more frequently on the heap, a larger branching factor can provide a significant speed-up. Huffman coding is described as probably the most famous data compression algorithm, a simple greedy algorithm that despite no longer being the state of the art was a major breakthrough in the 1950s, built bottom up from the characters in a text and their frequencies by repeatedly removing the two least frequent elements, combining them into a new node, and adding it back. A treap is the portmanteau of tree and heap, merging binary search trees, which offer the best average performance across insert, remove and search, with the priority tracking of a heap. Bloom filters store entries and allow fast lookup, in exchange for a tunable ratio of false positives, using a constant number of bits per key where a hash table would need space proportional to the key size. A disjoint set accounts for the partitioning of a set into disjoint groups.

Why pseudo-code in the book and real code here

The division of labour between the book and the repository is the pedagogical argument, and it is a reasonable one. Pseudo-code in a printed book cannot show what a real implementation costs, and a real implementation in a specific language hides the algorithm behind the language's own idioms. The book keeps the logic visible and the repository makes the consequences visible, which is why the profiling notebooks appear in the listing wherever the author had time to produce them. The Huffman entry in particular is annotated with a three step description of the algorithm, selecting and removing the two elements with the smallest frequency, creating a new node by combining them and summing the frequencies, and adding the new node back to the list. That kind of annotation is what makes the code readable as a companion to the prose. Two free articles are linked from the README for readers who want to look before buying, one on the knapsack problem used to illustrate how an algorithm is designed by progressive solution, and one on the Huffman coding algorithm itself.

Licence and maintenance shape how you can use it

The repository is under AGPL-3.0, and that is the licence to keep in mind before copying a file into a product, because AGPL obligations reach a networked service rather than stopping at distribution, which is a heavier obligation than the permissive licences most commercial code carries. The last push to the repository was on 2026-06-22, so the code is being touched, and there are no GitHub releases, which means you take the default branch as it stands rather than a tagged version. That combination suits the intended use, which is reading and learning, and it is a caution for the unintended one. If you want a dependency, the right move is to treat this as a worked reference and pick an implementation to reimplement in your own codebase, rather than to vendor the file and inherit both the licence obligations and the maintenance burden. The README's own quality signals are the lgtm language grade badges for JavaScript and Python, and the alert badge, which reflect the state of the code as scanned by that service rather than any claim by the project itself.

How to use this alongside the book

There is no installation step to describe, because the repository is not distributed as a package. What a reader does is clone the tree, open the directory for the language and structure they care about, and run the code in whatever way that language's own tooling expects, with the Python implementations sitting alongside Jupyter notebooks that can be executed cell by cell. The README's own instruction is to look at the livebook page for each structure, where the relevant chapter can be previewed, and to read the free chapter 1 excerpt on the knapsack problem to decide whether this is the algorithms book for you before buying the full text from Manning. That ordering matters for an adopter, because the repository is indexed by the book's chapters, not by topic, so a reader who wants a specific structure still has to know which chapter covers it. The book can be bought on the Manning website, and the chapter links in the README point at the livebook edition of the same chapter, so a reader can check whether the implementation matches the text they are reading before committing to the chapter.

Editorial conclusion

Adopt this repository if you are reading the Manning book Advanced Algorithms and Data Structures and want the same structures in Java, JavaScript or Python rather than in the book's pseudo-code, or if you want a worked reference implementation to read. Skip it if you need a maintained, packaged library, because nothing here is published as a dependency and the top level is three language directories rather than a build. Before you plan to reuse a piece, read the relevant chapter and the linked livebook text side by side with the implementation, and check the directory for the structure you need, since coverage differs by language and by chapter.

Frequently asked questions

What does the AlgorithmsAndDataStructuresInAction repository contain?

It holds implementations of the data structures and algorithms from the Manning book Advanced Algorithms and Data Structures, formerly Algorithms and Data Structures in Action, written in Java, JavaScript and Python, with Jupyter notebooks for profiling some of them. The top level is three language directories, not a published package.

Which data structures are covered?

The README covers the D-ary heap and Huffman compression in chapter 2, the Treap in chapter 3, the Bloom filter in chapter 4, the disjoint set in chapter 5 and the Trie in chapter 6, each linking to the relevant livebook chapter and to the implementations available in each language.

Is every structure available in every language?

No. The D-ary heap has Java, JavaScript, Python and a profiling notebook, Huffman compression has Java and Python, the Treap has Java and a Python notebook, the Bloom filter and the disjoint set are JavaScript only, and the Trie has Java and JavaScript, so coverage differs by structure and by language.

What licence applies to the code in this repository?

The repository is licensed under AGPL-3.0. The last push was on 2026-06-22 and there are no GitHub releases, so the code is taken from the default branch rather than a tagged version.

Official sources

  1. Issues
  2. License: AGPL-3.0
  3. mlarocca/AlgorithmsAndDataStructuresInAction on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mlarocca-algorithmsanddatastructuresinaction.svg)](https://hysenlabs.com/projects/mlarocca-algorithmsanddatastructuresinaction)

Was this useful?