Learn to Code ยท zero-dependency ยท MIT

larzalgo

Classic algorithms you can watch run.

Sorting and searching implemented for learning: each algorithm records every step - comparisons, swaps, the narrowing search - with counters and a frame-by-frame visualization. Correct and readable, so you can finally SEE how bubble sort or binary search actually works.

larzscript pkg install algo
View on GitHub →Learn the stack

What you get

Try it

import "algo" as algo
let r = algo.bubble_sort([5, 1, 4, 2, 8])
print(r["sorted"])
print(r["comparisons"], r["swaps"])
print(algo.binary_search([1, 2, 4, 5, 8], 5))
Output
[1, 2, 4, 5, 8]
10 4
3

Why it's in the Larz Stack

larzalgo is a real Larzscript package (larzscript pkg install algo) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.