Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompareFunc ¶
CompareFunc is a function to sort nodes in a queue
type IteratorFunc ¶
type IteratorFunc func(Item)
IteratorFunc is a function to be used for each item in the queue
type SortedUniqueList ¶
type SortedUniqueList struct {
// contains filtered or unexported fields
}
SortedUniqueList is a kind of priority queues, whose nodes are sorted Also, uniqueness of the node is guaranteed
func NewSortedUniqueQueue ¶
func NewSortedUniqueQueue(compareFunc CompareFunc) *SortedUniqueList
NewSortedUniqueQueue is a constructor for the SortedUniqueList
func (*SortedUniqueList) Add ¶
func (q *SortedUniqueList) Add(item Item)
Add a node to the SortedUniqueList
func (*SortedUniqueList) Delete ¶
func (q *SortedUniqueList) Delete(i Item)
Delete deletes a node from the queue
func (*SortedUniqueList) First ¶
func (q *SortedUniqueList) First() Item
First retrieves the first node in the queue
func (*SortedUniqueList) ForEach ¶
func (q *SortedUniqueList) ForEach(iteratorFunc IteratorFunc)
ForEach runs IteratorFunc for each item in the queue
func (*SortedUniqueList) Len ¶
func (q *SortedUniqueList) Len() int
Len returns the length of the queue