keon/algorithms ? reverse-engineered prompt

Reverse engineered prompt

Build me a clean Python library of small, easy to read examples of classic data structures and algorithms.

I want it organized by topic like sorting, searching, graphs, trees, dynamic programming, backtracking, strings, arrays, and common data structures such as heaps, tries, stacks, queues, hash tables, and binary search trees. Each function or class should be self contained, with simple docstrings, type hints, and a short note about how fast it is. The goal is for someone to learn from the code, so keep the implementations minimal and clear instead of clever.

Please include a few working examples for things like merge sort, binary search, shortest path on a graph, coin change, permutations, and basic tree traversal. Also add tests that cover the main algorithms and make sure the package is easy to import and use from Python. If you need to check current best practices or library docs, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab