Back to browse
Algorithms and Data Structures in TypeScript – Free Book (~400 Pages)

Algorithms and Data Structures in TypeScript – Free Book (~400 Pages)

by jsontwikkeling·Mar 13, 2026·65 points·22 comments

AI Analysis

MidNiche Gem

Another algorithms book, but at least the code is typed and tested.

Strengths
  • Executable TypeScript code instead of language-agnostic pseudocode
  • Test suite ensures implementations actually work as described
  • Covers full undergraduate curriculum from sorting to NP-completeness
Weaknesses
  • AI-assisted content generation reduces the craft signal compared to hand-written books
  • Standard curriculum offers no novel approach to teaching these concepts
Category
Target Audience

TypeScript developers and CS students

Similar To

The Algorithms/JavaScript · Grokking Algorithms · CLRS

Post Description

I started writing this book 10 years ago in JavaScript, got through a few chapters (asymptotic notation, basic techniques, start of sorting), and then abandoned it.

Recently I picked it back up, converted everything to TypeScript, and used AI (Zenflow [1] + Claude Opus 4.6) to complete the remaining chapters. I provided the structure, direction, and initial chapters; the AI generated the bulk of the remaining content under a spec-driven workflow.

The book covers roughly a first 1-2 year CS curriculum: sorting, dynamic programming, graph algorithms, trees, heaps, hash tables, and more. All code is executable, typed with generics/interfaces, and covered with tests.

I've thoroughly reviewed several chapters (sorting, DP, graphs) and done a high-level pass on the rest. Currently in beta — corrections and contributions are welcome.

MIT licensed. Inspired by Wirth's "Algorithms and Data Structures", SICP, and CLRS.

Code and tests: https://github.com/amoilanen/Algorithms-with-Typescript

[1] https://zencoder.ai/zenflow

Similar Projects