Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MaxPQ ¶
type MaxPQ struct {
// contains filtered or unexported fields
}
func (*MaxPQ) Peek ¶
Returns the maximum item in the queue without removing it
The complexity is O(1)
func (*MaxPQ) Pop ¶
Pop removes the maximum element from the heap and returns it.
The complexity is O(log(n)) where n = p.Size().
func (*MaxPQ) Push ¶
Push pushes the element x onto the heap.
The complexity is O(log(n)) where n = p.Size().
type MinPQ ¶
type MinPQ struct {
// contains filtered or unexported fields
}
func (*MinPQ) Peek ¶
Returns the minimum item in the queue without removing it
The complexity is O(1)
func (*MinPQ) Pop ¶
Pop removes the minimum element from the heap and returns it.
The complexity is O(log(n)) where n = p.Size().
func (*MinPQ) Push ¶
Push pushes the element x onto the heap.
The complexity is O(log(n)) where n = p.Size().
Click to show internal directories.
Click to hide internal directories.