shippedOct – Dec 2024
Typestruct
A typed data structures and algorithms library for TypeScript
resultPublished on npm
Typestruct is a TypeScript library of common data structures and algorithms, published on npm (npm install typestruct). It includes:
- Data structures: linked lists, binary search trees, disjoint sets, graphs (as adjacency lists and matrices), and an LRU cache.
- Algorithms: sorting, searching, BFS and DFS traversal, and union-find.
All of them are fully generic and typed. I wrote it alongside my competitive-programming practice, and implementing each structure behind a clean public API made me think about invariants I’d been taking for granted.