Basically, I know how to create graph data structures and use Dijkstra\'s algorithm in programming languages where side effects are allowed. Typically, graph algorithms use
I would love to hear about some really clever technique, but I think there are two fundamental approaches:
That is what's done in functional programming. If the compiler/interpreter is any good, it will help manage memory for you. In particular, you'll want to make sure that you use tail recursion, if you happen to recurse in any of your functions.