OSDN Git Service

Update Go library to r60.
[pf3gnuchains/gcc-fork.git] / libgo / go / container / heap / heap.go
index f2b8a75..2dfe5b4 100644 (file)
@@ -21,8 +21,7 @@ type Interface interface {
        Pop() interface{}
 }
 
-
-// A heaper must be initialized before any of the heap operations
+// 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.
 // Its complexity is O(n) where n = h.Len().
@@ -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