you can use recur. it calls the fn/loop it's contained in with new args. (so, with the updated array and queue)
On Dec 7, 8:19 pm, ajay <ajgop...@gmail.com> wrote: > Hi all, > > I am new to FP in general and I am trying to pick up Clojure. I am > having trouble thinking in FP terms. > > I am trying to implement the Dijkstra algorithm for shortest paths in > Graph in Clojure. If this succeeds, I will implement all the advanced > graph algos I am learning in this course in Clojure and post in > online. > > My concerns regarding implementing Dijkstra in Clojure are following: > > 1. The way I've learnt Dijkstra, there is a distance array and we keep > on updating it if we find a shorter path. Since, things are immutable, > how do I do it? > 2. Does Clojure have a Priority Queue data structure inbuilt. I would > need that for Dijkstra algorithm. > > Thanks, > Ajay G. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en