FAQ
Using the current builtin "container/heap" package to create a heap or
priority queue usually leads to a verbose code. I created the
"github.com/golangplus/container/heap" package as an alternative.

The main advantages are:

    - Elements need not be converted into interfaces for popping and
    pushing, this increases the efficiency
    - The implementation code is more straight forward and less confusion.
    The pop/push methods defined can be directly used other than calling to
    heap functions.
    - Closure version of functions makes the creation of heap of
    self-defined data structure less verbose. No need to implement the
    interfaces for each type or each comparison criteria. Benchmark also show
    obvious performance increase compared with using the interface.

Go to the blog article
<http://daviddengcn.blogspot.com/2015/06/an-alternative-design-for-containerheap.html> for
more details.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Pieter Droogendijk at Jun 19, 2015 at 3:35 pm
    I think your link is broken

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • David DENG at Jun 19, 2015 at 3:37 pm
    http://daviddengcn.blogspot.com/2015/06/an-alternative-design-for-containerheap.html
    On Friday, June 19, 2015 at 8:35:24 AM UTC-7, Pieter Droogendijk wrote:

    I think your link is broken
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matthew Kane at Jun 19, 2015 at 3:37 pm
    I think it’s just linking directly to the package name that’s broken.
    It’s at that import path on godoc:
    http://godoc.org/github.com/golangplus/container/heap The link in the
    blog article works OK.

    On Fri, Jun 19, 2015 at 11:35 AM, Pieter Droogendijk
    wrote:
    I think your link is broken

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    matt kane's brain
    im: mkb.dirtyorg@gmail.com (gtalk) / mkbatwerk (AIM)
    twitter: the_real_mkb / nynexrepublic
    http://hydrogenproject.com

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Pieter Droogendijk at Jun 19, 2015 at 4:01 pm
    Yeah, just the github link in the top post. I got there through the blog
    post.
    On Friday, June 19, 2015 at 5:38:07 PM UTC+2, mkb wrote:

    I think it’s just linking directly to the package name that’s broken.
    It’s at that import path on godoc:
    http://godoc.org/github.com/golangplus/container/heap The link in the
    blog article works OK.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Nick Craig-Wood at Jun 19, 2015 at 4:19 pm

    On 19/06/15 16:30, David DENG wrote:
    Using the current builtin "container/heap" package to create a heap or
    priority queue usually leads to a verbose code. I created the
    "github.com/golangplus/container/heap" package as an alternative.

    The main advantages are:

    * Elements need not be converted into interfaces for popping and
    pushing, this increases the efficiency
    * The implementation code is more straight forward and less confusion.
    The pop/push methods defined can be directly used other than calling
    to heap functions.
    * Closure version of functions makes the creation of heap of
    self-defined data structure less verbose. No need to implement the
    interfaces for each type or each comparison criteria. Benchmark also
    show obvious performance increase compared with using the interface.

    Go to the blog article
    <http://daviddengcn.blogspot.com/2015/06/an-alternative-design-for-containerheap.html> for
    more details.
    In https://github.com/ncw/gotemplate I made a generic version of
    container/heap

    Here is an example of how to use it.

    http://play.golang.org/p/j0XRoIslsy

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 19, '15 at 3:30p
activeJun 19, '15 at 4:19p
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase