Elements of Programming, In Ruby
summary
A Ruby reimplementation of Elements of Programming claims that many algorithms become generic and provably efficient when expressed by small, precise components. It implements fast exponentiation for any associative operation (works for addition, multiplication, matrix multiplication and yields Fibonacci via matrix powers) and constructs a stable in-place sort built from swap reverse rotate leading to a stable partition and O(n log n) behavior, all written as Ruby lambdas and array mutations.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 3:53Stepanov's math approach
- 8:52Associative ops and exponentiation
- 14:30Stable in-place sorting
- 21:39Practical takeaways
- 26:18Math in programming








