@@ -33,13 +33,13 @@ provides the following interface:
33
33
``` julia
34
34
# Let `h` be a heap, `i` be a handle, and `v` be a value.
35
35
36
- i = push! (h, v) # adds a value to the heap and and returns a handle to v
36
+ i = push! (h, v) # adds a value to the heap and and returns a handle to v
37
37
38
- update! (h, i, v) # updates the value of an element (referred to by the handle i)
38
+ update! (h, i, v) # updates the value of an element (referred to by the handle i)
39
39
40
- delete! (h, i) # deletes the node with handle i from the heap
40
+ delete! (h, i) # deletes the node with handle i from the heap
41
41
42
- v, i = top_with_handle (h) # returns the top value of a heap and its handle
42
+ v, i = top_with_handle (h) # returns the top value of a heap and its handle
43
43
```
44
44
45
45
Currently, both min/max versions of binary heap (type ` BinaryHeap ` ) and
@@ -49,16 +49,16 @@ Examples of constructing a heap:
49
49
50
50
``` julia
51
51
h = BinaryMinHeap {Int} ()
52
- h = BinaryMaxHeap {Int} () # create an empty min/max binary heap of integers
52
+ h = BinaryMaxHeap {Int} () # create an empty min/max binary heap of integers
53
53
54
54
h = BinaryMinHeap ([1 ,4 ,3 ,2 ])
55
- h = BinaryMaxHeap ([1 ,4 ,3 ,2 ]) # create a min/max heap from a vector
55
+ h = BinaryMaxHeap ([1 ,4 ,3 ,2 ]) # create a min/max heap from a vector
56
56
57
57
h = MutableBinaryMinHeap {Int} ()
58
- h = MutableBinaryMaxHeap {Int} () # create an empty mutable min/max heap
58
+ h = MutableBinaryMaxHeap {Int} () # create an empty mutable min/max heap
59
59
60
60
h = MutableBinaryMinHeap ([1 ,4 ,3 ,2 ])
61
- h = MutableBinaryMaxHeap ([1 ,4 ,3 ,2 ]) # create a mutable min/max heap from a vector
61
+ h = MutableBinaryMaxHeap ([1 ,4 ,3 ,2 ]) # create a mutable min/max heap from a vector
62
62
```
63
63
64
64
## Using alternate orderings
@@ -119,7 +119,7 @@ This package includes an implementation of a binary min-max heap (`BinaryMinMaxH
119
119
120
120
Examples:
121
121
``` julia
122
- h = BinaryMinMaxHeap {Int} () # create an empty min-max heap with integer values
122
+ h = BinaryMinMaxHeap {Int} () # create an empty min-max heap with integer values
123
123
124
124
h = BinaryMinMaxHeap ([1 , 2 , 3 , 4 ]) # create a min-max heap from a vector
125
125
```
0 commit comments