This repo is a work-in-progress port of Bradfield School of Computer Science's Practical Algorithms and Data Structures to TypeScript. That book is subject to a Creative Commons license (having itself been forked from another CC-licensed book), and the source code may be found here. The content of this repo is licensed in kind.
I have stuck reasonably close (but certainly not 100%) to the spirit of the Python implementations provided. But TypeScript is not Python, and I certainly have not matched expression-for-expression. For example, I had to make some typing decisions that are not necessary in the Python version, and insert type guards to accommodate static types.
Tests accompany the code, usually in the corresponding whatever.test.ts
file. The tests assume the Deno runtime, because Deno provides a low-fuss way to get a TypeScript project running with testing batteries included 🦕 The full suite can be run from the project directory with deno test
.
The non-test code is not particular to Deno, and it is suitable for transpiling to JavaScript with your favourite TypeScript toolchain. Most likely, you are here to read the code, not run it. None of these implementations should be considered robust, performant, or suitable for production use.
Hopefully these translations make the book just a little bit more accessible to folks who know JS or TS, but not Python. 🙃
The numbers refer to the corresponding sections of the book.