Documentation
¶
Index ¶
- func Float64CompFunc(v1 Value, v2 Value) int
- func FloatHeapSort(data []Value)
- func HeapSort(data []Value, cmf CompFunc)
- func IntCompFunc(v1 Value, v2 Value) int
- func IntHeapSort(data []Value)
- type AvlNode
- func (root *AvlNode) Add(v Value) (new_root *AvlNode, new_deeper int)
- func (root *AvlNode) BalanceLeft() *AvlNode
- func (root *AvlNode) BalanceRight() *AvlNode
- func (root *AvlNode) GetHeight() int
- func (root *AvlNode) Print(level int)
- func (root *AvlNode) Remove(v Value) (new_root *AvlNode, junk *AvlNode)
- func (root *AvlNode) RemoveLeftMostDescendant() (new_root *AvlNode, junk *AvlNode)
- func (root *AvlNode) RestoreLeftBalance(oldbf int) *AvlNode
- func (root *AvlNode) RestoreRightBalance(oldbf int) *AvlNode
- type AvlTree
- type Chain
- type CompFunc
- type Hash
- func (hash *Hash) AddData(key Value, value Value)
- func (hash *Hash) Clear()
- func (hash *Hash) GotoChain(ind []int) *Chain
- func (hash *Hash) InitSubHash(ind []int, n int)
- func (hash *Hash) RemoveData(key Value)
- func (hash *Hash) Search(key Value) (value Value)
- func (hash *Hash) SearchChain(key Value) *Chain
- func (hash *Hash) SearchNode(key Value) (last *Node, pcc *Chain, result *Node)
- type Heap
- type Key
- type KeyToIndexFunc
- type LList
- func (ll *LList) Flush()
- func (ll *LList) Get(ind int) (value *Value)
- func (ll *LList) GetFirst() (value *Value)
- func (ll *LList) GetLast() (value *Value)
- func (ll *LList) GetN() int
- func (ll *LList) Pop() (value Value)
- func (ll *LList) PopFirst() (value Value)
- func (ll *LList) Push(value Value) int
- type Node
- type PQueue
- type Set
- func (sres *Set) Co(s1 *Set)
- func (oset *Set) CopyFrom(sset *Set) (is_err bool)
- func (sres *Set) Diff(s1 *Set, s2 *Set)
- func (s1 *Set) Empty()
- func (s1 *Set) Full()
- func (set *Set) GetAllLabel() (labels []int)
- func (set *Set) GetLabel(ind int) bool
- func (set *Set) GetNLabel() int
- func (set *Set) GetSize() int
- func (sres *Set) Inter(s1 *Set, s2 *Set)
- func (set *Set) IsEmpty() bool
- func (set *Set) Load(fload io.Reader)
- func (set *Set) Save(fsav io.Writer)
- func (set *Set) SetLabel(ind int, label bool)
- func (sres *Set) Union(s1 *Set, s2 *Set)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float64CompFunc ¶
func FloatHeapSort ¶
func FloatHeapSort(data []Value)
func IntCompFunc ¶
func IntHeapSort ¶
func IntHeapSort(data []Value)
Types ¶
type AvlNode ¶ added in v1.1.0
type AvlNode struct {
// contains filtered or unexported fields
}
func InitAvlNode ¶ added in v1.1.0
func (*AvlNode) BalanceLeft ¶ added in v1.1.0
func (*AvlNode) BalanceRight ¶ added in v1.1.0
func (*AvlNode) RemoveLeftMostDescendant ¶ added in v1.1.0
func (*AvlNode) RestoreLeftBalance ¶ added in v1.1.0
func (*AvlNode) RestoreRightBalance ¶ added in v1.1.0
type AvlTree ¶ added in v1.1.0
type AvlTree struct {
// contains filtered or unexported fields
}
func InitAvlTree ¶ added in v1.1.0
func InitFloatAvlTree ¶ added in v1.1.0
func InitFloatAvlTree() *AvlTree
func InitIntAvlTree ¶ added in v1.1.0
func InitIntAvlTree() *AvlTree
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
* Hash 非叶节点结构, 若其子节点为叶节点, 则 len(sublist) = 0,
- head 指向首个子节点, tail 指向最后一个子节点.
- 若其子节点为非叶节点, 则 head = tail = nil, sublist 指向子节点数组,
- n 为子节点个数.
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
* Hash 结构
func InitTreeHash ¶
func InitTreeHash(n []int, ktoi KeyToIndexFunc, comp CompFunc) *Hash
func (*Hash) AddData ¶
* 向 hash 中增加一个叶节点.
- \param hash 待增加hash
- \param key 增加节点的 key
- \param value 增加节点的 value
func (*Hash) InitSubHash ¶
func (*Hash) RemoveData ¶
* 删除 hash 中以 key 为索引的节点
- \param hash 待删除节点所在的 hash
- \param key 待删除节点的索引 (key)
func (*Hash) Search ¶
* 核心函数, 利用 Hash 完成查找,
- \param hash 已经建立好的 Hash
- \param key 待查找的 key
- \param value 返回查找得到的 value (nil: 没找到)
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
func InitFloatHeap ¶
func InitFloatHeap() *Heap
func InitIntHeap ¶
func InitIntHeap() *Heap
type KeyToIndexFunc ¶
Click to show internal directories.
Click to hide internal directories.