Documentation ¶
Overview ¶
a simple implementation of a priority queue based on golangs heap structure
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitArray ¶
type BitArray struct {
// contains filtered or unexported fields
}
This struct implements a BitArray with variable bit width. Values in BitArray can use either 1, 2, 4 or 8 bits (respectively 8, 4, 2 or 1 values can be represented using a single byte).
func NewBitArray ¶
Creates a new BitArray that can hold 'capacity' many words of size bitsPerWord
func (*BitArray) BitsPerWord ¶
type PriorityQueue ¶
type PriorityQueue []*Item
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
remove and return item with highest priority
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
add new item to the priority queue
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.