Part I of The Algorithm Codex
The first draft of Part I: Searching and Sorting for The Algorithm Codex is now officially ready for readers. This opening section establishes the foundational theme of the book: that structure is the primary driver of computational efficiency. You can read the full draft online at matcom.github.io/codex or download a high-quality PDF version on Gumroad on a pay-what-you-want basis to support the project.
This draft encompasses 19 distinct algorithms across six chapters, focusing on the core logic and intuitions that make them work:
Basic Search: Establishing the universal but expensive baseline of searching through unstructured sequences.
Efficient Search: Introducing the “magical” scaling of binary search and bisection, extending these concepts to abstract decision spaces through predicate search.
Basic Sorting: Analyzing the “geometry of inversions” to understand why simple approaches like Selection and Insertion sort are naturally bounded by a quadratic ceiling.
Efficient Sorting: Breaking the quadratic barrier with the recursive divide-and-conquer strategies of Merge Sort and Quick Sort.
Rankings and Selection: Implementing strategies for order statistics, including the randomized Quick Select and the deterministic “Median of Medians”.
Linear Time Sorting: Bypassing the theoretical limits of comparison-based algorithms by exploiting domain-specific constraints with Counting and Radix sort.
While the core content is ready, the Codex remains a work in progress. I plan to further extend the explanations with more intuitive descriptions and perform deeper analysis without getting into overly formal proofs. I am also considering the addition of a few more clever algorithms to round out this section before moving on to Part II on foundational data structures (lists, queues, stacks, and dictionaries).
Over the next two weeks, I will be adapting several chapters into articles for The Computist Journal. These posts will focus specifically on the beauty and underlying intuitions of binary search and efficient sorting, rather than the nitty-gritty implementation details.
If you find this resource valuable, please consider supporting the ongoing development of the remaining seven parts by getting the PDF on Gumroad. Your support directly enables the continuation of this project.


