On Dec 15, 1:49 am, ataggart <[email protected]> wrote:
> On Dec 14, 5:48 am, Mark Tomko <[email protected]> wrote:
>
> > I wrote this implementation of a heap (or priority queue) in pure
> > Clojure:
>
> >http://pastebin.com/m2ab1ad5a
>
> > It's probably not of any quality sufficient to be make it to the
> > contrib package, but it seems to work.  Any thoughts on how it might
> > be improved?
>
> > Thanks,
> > Mark
>
> Ideally such a collection would be usable with existing functions,
> e.g. pop, peek.  To accomplish that you really need to implement
> against the expected java interfaces.
>
> I've been playing with the deftype/defprotocol stuff in the "new"
> branch, so I figured I'd try to apply that to this problem.  This is
> what I came up with:
>
> http://gist.github.com/256815

To be clear, my implementation just uses a sorted list, not a true
heap tree.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to