diff options
Diffstat (limited to 'src/pkg/container/heap/heap.go')
-rw-r--r-- | src/pkg/container/heap/heap.go | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/pkg/container/heap/heap.go b/src/pkg/container/heap/heap.go index 5b68827df..2dfe5b43c 100644 --- a/src/pkg/container/heap/heap.go +++ b/src/pkg/container/heap/heap.go @@ -21,7 +21,6 @@ type Interface interface { Pop() interface{} } - // A heap must be initialized before any of the heap operations // can be used. Init is idempotent with respect to the heap invariants // and may be called whenever the heap invariants may have been invalidated. @@ -35,7 +34,6 @@ func Init(h Interface) { } } - // Push pushes the element x onto the heap. The complexity is // O(log(n)) where n = h.Len(). // @@ -44,7 +42,6 @@ func Push(h Interface, x interface{}) { up(h, h.Len()-1) } - // Pop removes the minimum element (according to Less) from the heap // and returns it. The complexity is O(log(n)) where n = h.Len(). // Same as Remove(h, 0). @@ -56,7 +53,6 @@ func Pop(h Interface) interface{} { return h.Pop() } - // Remove removes the element at index i from the heap. // The complexity is O(log(n)) where n = h.Len(). // @@ -70,7 +66,6 @@ func Remove(h Interface, i int) interface{} { return h.Pop() } - func up(h Interface, j int) { for { i := (j - 1) / 2 // parent @@ -82,7 +77,6 @@ func up(h Interface, j int) { } } - func down(h Interface, i, n int) { for { j1 := 2*i + 1 |