Documentation ¶
Index ¶
- func PrintBTreeBFS(root *TreeNode)
- func PrintBTreeDFS(root *TreeNode)
- func PrintList(node *ListNode)
- type Dag
- type Deque
- func (d *Deque) IsEmpty() bool
- func (d *Deque) PeekFirst() interface{}
- func (d *Deque) PeekLast() interface{}
- func (d *Deque) PopFirst() interface{}
- func (d *Deque) PopLast() interface{}
- func (d *Deque) PushFirst(elem interface{})
- func (d *Deque) PushLast(elem interface{})
- func (d *Deque) Size() int
- type DoublyLList
- type DoublyLNode
- type Elem
- type Heap
- type ListNode
- type Lmap
- type MonotonicQueue
- type PatternFinder
- type PriorityQueue
- func (pq *PriorityQueue) Peek() interface{}
- func (pq *PriorityQueue) Pop() interface{}
- func (pq *PriorityQueue) PopWithPrio() []interface{}
- func (pq *PriorityQueue) Push(value interface{}, prio interface{})
- func (pq *PriorityQueue) Remove(value interface{}) interface{}
- func (pq *PriorityQueue) Size() int
- type Queue
- type Stack
- type TreeNode
- type UF
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintBTreeBFS ¶
func PrintBTreeBFS(root *TreeNode)
func PrintBTreeDFS ¶
func PrintBTreeDFS(root *TreeNode)
Types ¶
type Dag ¶
type Dag struct { // the size of the graph Size int // adjacent table for each vertex AdjTable map[int][]int // stock the result of sort, "source" vertex on the top // the vertex "pointed to" at the bottom Sorted *Stack // contains filtered or unexported fields }
func (*Dag) TopologicalSort ¶
func (d *Dag) TopologicalSort()
type DoublyLList ¶
type DoublyLList struct {
Head, Tail *DoublyLNode
Len int
}
Doubly Linked List
func NewDoublyLList ¶
func NewDoublyLList() *DoublyLList
func (*DoublyLList) Delete ¶
func (dl *DoublyLList) Delete(node *DoublyLNode)
type DoublyLNode ¶
type DoublyLNode struct {
Key, Val interface{}
Prev, Next *DoublyLNode
}
Doubly Linked Node
func NewDoublyLNode ¶
func NewDoublyLNode(k, v interface{}) *DoublyLNode
type Lmap ¶
type Lmap struct { Map map[interface{}]*DoublyLNode DList *DoublyLList }
Linked Hash Map
func (*Lmap) BecomeNewest ¶
func (lm *Lmap) BecomeNewest(k interface{})
func (*Lmap) PopEldest ¶
func (lm *Lmap) PopEldest() *DoublyLNode
type MonotonicQueue ¶
type MonotonicQueue struct {
// contains filtered or unexported fields
}
func NewMonotonicQueue ¶
func NewMonotonicQueue() *MonotonicQueue
func (*MonotonicQueue) IsEmpty ¶
func (mq *MonotonicQueue) IsEmpty() bool
func (*MonotonicQueue) Max ¶
func (mq *MonotonicQueue) Max() interface{}
func (*MonotonicQueue) Pop ¶
func (mq *MonotonicQueue) Pop(elem interface{})
func (*MonotonicQueue) Push ¶
func (mq *MonotonicQueue) Push(elem interface{})
func (*MonotonicQueue) Size ¶
func (mq *MonotonicQueue) Size() int
type PatternFinder ¶
type PatternFinder struct {
// contains filtered or unexported fields
}
func (*PatternFinder) FindIn ¶
func (pf *PatternFinder) FindIn(target string) []int
func (*PatternFinder) GetLPS ¶
func (pf *PatternFinder) GetLPS() []int
func (*PatternFinder) Pattern ¶
func (pf *PatternFinder) Pattern() []rune
type PriorityQueue ¶
func NewPQ ¶
func NewPQ(values interface{}, prios interface{}, popLowest bool) *PriorityQueue
build a priority queue with a slice of value and a slice of priority
func (*PriorityQueue) Peek ¶
func (pq *PriorityQueue) Peek() interface{}
Pop without remove elem from PQ
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) PopWithPrio ¶
func (pq *PriorityQueue) PopWithPrio() []interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(value interface{}, prio interface{})
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(value interface{}) interface{}
func (*PriorityQueue) Size ¶
func (pq *PriorityQueue) Size() int
Click to show internal directories.
Click to hide internal directories.