Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Less ¶
type Less func(a interface{}, b interface{}) bool
Less is compare function for elements in queue
type PriorityDeque ¶
type PriorityDeque struct {
// contains filtered or unexported fields
}
PriorityDeque is a priority double-ended queue
func NewPriorityDeque ¶
func NewPriorityDeque(less Less) *PriorityDeque
NewPriorityDeque create a new PriorityDeque
func (*PriorityDeque) Insert ¶
func (q *PriorityDeque) Insert(ele interface{})
Insert an item into priority deque
func (*PriorityDeque) Len ¶
func (q *PriorityDeque) Len() int
Len return the length of the priority deque
func (*PriorityDeque) Max ¶ added in v1.0.0
func (q *PriorityDeque) Max() interface{}
Max return the max value in priority deque
func (*PriorityDeque) Min ¶ added in v1.0.0
func (q *PriorityDeque) Min() interface{}
Min return the min value in priority deque
func (*PriorityDeque) PopMax ¶
func (q *PriorityDeque) PopMax() interface{}
PopMax pop the max value in priority deque
func (*PriorityDeque) PopMin ¶
func (q *PriorityDeque) PopMin() interface{}
PopMin pop the min value in priority deque
Click to show internal directories.
Click to hide internal directories.