2 Comments
User's avatar
Neural Foundry's avatar

This is a brilliant initiative! The literate programming aproach to algorithms really fills a gap between dry textbooks and pure code repos. I've always struggled explaining complexity analysis to junior devs without losing them in notation, and having that envelope-level breakdown inline wth the code could be huge. Binary search as a starting point is perfect since even experienced folks sometimes miss the nuances of boundary conditions.

Alejandro Piad Morffis's avatar

Thanks! Yeah bisection is tricky, I always have to think twice if I want to make left equal to middle or middle plus one, depending if you want the first greater than or the last smaller than… it's also the most beautiful algorithm because it perfectly shows the link between structure and efficiency.