interesting. maybe I can change my interface in this thing I abandoned a while back: http://code.google.com/p/jc-pheap/
to match that of the contrib, "priority map". I had gotten stuck figuring out the right interface/usage/idioms for clojure and kinda messed the whole thing up in later checkins. Then clojure went to GIT and I pretty much lost the remaining interesting having started in svn. but now I have a reason again... if I can ever get a comfortable programming environment in clojure (never was able to before). I can see how it works compared to work others are doing. thanks. On Sat, Jan 22, 2011 at 2:14 PM, Mark Engelberg <mark.engelb...@gmail.com>wrote: > Clojure already has a built in queue. The empty queue is: > clojure.lang.PersistentQueue/EMPTY > and then you can use all the usual conj/into/pop/peek functions on it. > For some reason, PersistentQueue is not documented, so new users have > no reason to know about it until they happen to ask about it here. > > You might be interested to compare your priority queue implementation > to my "priority map" in 1.3 alpha's contrib, which also supports > updating items' priorities. > > As far as I can tell, your priority queue's pop is not O(1), because > the underlying sorted map doesn't support "first" in O(1). It's > actually O(log32#of priorities). My priority map is similar, and I > agree that this behavior is quite fast, but it's worth noting that > it's not truly O(1). > > -- > 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 > -- 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