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
- 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
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 email@example.com.
For more options, visit https://groups.google.com/d/optout.