diff options
Diffstat (limited to 'src/pkg/container/heap/heap.go')
-rw-r--r-- | src/pkg/container/heap/heap.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/container/heap/heap.go b/src/pkg/container/heap/heap.go index 52c8507b4..c467a1191 100644 --- a/src/pkg/container/heap/heap.go +++ b/src/pkg/container/heap/heap.go @@ -22,7 +22,7 @@ import "sort" // min-heap with the following invariants (established after // Init has been called or if the data is empty or sorted): // -// !h.Less(j, i) for 0 <= i < h.Len() and j = 2*i+1 or 2*i+2 and j < h.Len() +// !h.Less(j, i) for 0 <= i < h.Len() and 2*i+1 <= j <= 2*i+2 and j < h.Len() // // Note that Push and Pop in this interface are for package heap's // implementation to call. To add and remove things from the heap, @@ -78,7 +78,7 @@ func Remove(h Interface, i int) interface{} { return h.Pop() } -// Fix reestablishes the heap ordering after the element at index i has changed its value. +// Fix re-establishes the heap ordering after the element at index i has changed its value. // Changing the value of the element at index i and then calling Fix is equivalent to, // but less expensive than, calling Remove(h, i) followed by a Push of the new value. // The complexity is O(log(n)) where n = h.Len(). |