Documentation ¶
Index ¶
- type Iterator
- func (iter *Iterator) GetNext(cur *Node, idx int) *Node
- func (iter *Iterator) GetNode() *Node
- func (iter *Iterator) GetPrev(cur *Node, idx int) *Node
- func (iter *Iterator) Next() (result bool)
- func (iter *Iterator) Prev() (result bool)
- func (iter *Iterator) SetNode(n *Node)
- func (iter *Iterator) ToHead()
- func (iter *Iterator) ToTail()
- func (iter *Iterator) Value() interface{}
- type Node
- type PriorityQueue
- func (pq *PriorityQueue) Get(value interface{}) (interface{}, bool)
- func (pq *PriorityQueue) GetAround(value interface{}) [3]interface{}
- func (pq *PriorityQueue) GetAroundNode(value interface{}) [3]*Node
- func (pq *PriorityQueue) GetNode(value interface{}) (*Node, bool)
- func (pq *PriorityQueue) GetRange(k1, k2 interface{}) []interface{}
- func (pq *PriorityQueue) Index(idx int) (interface{}, bool)
- func (pq *PriorityQueue) IndexNode(idx int) (*Node, bool)
- func (pq *PriorityQueue) Iterator() *Iterator
- func (pq *PriorityQueue) Pop() (result interface{}, ok bool)
- func (pq *PriorityQueue) Push(value interface{})
- func (pq *PriorityQueue) Remove(vlaue interface{}) (interface{}, bool)
- func (pq *PriorityQueue) RemoveIndex(idx int) (interface{}, bool)
- func (pq *PriorityQueue) RemoveNode(node *Node)
- func (pq *PriorityQueue) Size() int
- func (pq *PriorityQueue) String() string
- func (pq *PriorityQueue) Top() (result interface{}, ok bool)
- func (pq *PriorityQueue) Values() []interface{}
- type TraversalMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func NewIteratorWithCap ¶
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func New ¶
func New(Compare compare.Compare) *PriorityQueue
func (*PriorityQueue) Get ¶
func (pq *PriorityQueue) Get(value interface{}) (interface{}, bool)
func (*PriorityQueue) GetAround ¶
func (pq *PriorityQueue) GetAround(value interface{}) [3]interface{}
func (*PriorityQueue) GetAroundNode ¶
func (pq *PriorityQueue) GetAroundNode(value interface{}) [3]*Node
func (*PriorityQueue) GetNode ¶
func (pq *PriorityQueue) GetNode(value interface{}) (*Node, bool)
func (*PriorityQueue) GetRange ¶
func (pq *PriorityQueue) GetRange(k1, k2 interface{}) []interface{}
func (*PriorityQueue) Index ¶
func (pq *PriorityQueue) Index(idx int) (interface{}, bool)
func (*PriorityQueue) Iterator ¶
func (pq *PriorityQueue) Iterator() *Iterator
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() (result interface{}, ok bool)
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(value interface{})
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(vlaue interface{}) (interface{}, bool)
func (*PriorityQueue) RemoveIndex ¶
func (pq *PriorityQueue) RemoveIndex(idx int) (interface{}, bool)
func (*PriorityQueue) RemoveNode ¶ added in v0.7.2
func (pq *PriorityQueue) RemoveNode(node *Node)
func (*PriorityQueue) Size ¶
func (pq *PriorityQueue) Size() int
func (*PriorityQueue) String ¶
func (pq *PriorityQueue) String() string
func (*PriorityQueue) Top ¶
func (pq *PriorityQueue) Top() (result interface{}, ok bool)
func (*PriorityQueue) Values ¶
func (pq *PriorityQueue) Values() []interface{}
type TraversalMethod ¶
type TraversalMethod int
const ( //DLR 先值 然后左递归 右递归 下面同理 DLR TraversalMethod //LDR 先从左边有序访问到右边 从小到大 LDR // LRD 同理 LRD // DRL 同理 DRL // RDL 先从右边有序访问到左边 从大到小 RDL // RLD 同理 RLD )
Click to show internal directories.
Click to hide internal directories.