Hacker News new | ask | show | jobs
by cyberax 615 days ago
Nothing. For complex algorithms, I prefer to think in invariants: "this condition should hold here, so this variable must be that".

I guess, for me the only exception is the dynamic programming algorithms. I re-discovered the wave algorithm (aka Dijkstra's algorithm) for solving mazes while writing in BASIC at school, and since then, I tend to reformulate any dynamic programming task as a path search in a maze.