From: Rob Pike Date: Tue, 17 Jan 2012 21:07:47 +0000 (-0800) Subject: container/heap: better package documentation X-Git-Tag: weekly.2012-01-20~77 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4c40558c749744c7c914902b83b58ee55c9ca0c5;p=gostls13.git container/heap: better package documentation Fixes #1820. R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/5540073 --- diff --git a/src/pkg/container/heap/heap.go b/src/pkg/container/heap/heap.go index ca91139675..7af636b451 100644 --- a/src/pkg/container/heap/heap.go +++ b/src/pkg/container/heap/heap.go @@ -3,7 +3,13 @@ // license that can be found in the LICENSE file. // Package heap provides heap operations for any type that implements -// heap.Interface. +// heap.Interface. A heap is a tree with the property that each node is the +// highest-valued node in its subtree. +// +// A heap is a common way to impement a priority queue. To build a priority +// queue, implement the Heap interface with the (negative) priority as the +// ordering for the Less method, so Push adds items while Pop removes the +// highest-priority item from the queue. // package heap