strategy

package
v0.0.0-...-0cd90d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLRUCache

func NewLRUCache(capacity int) *lRUCache

func NewTrieNode

func NewTrieNode(char string) *trideNode

Types

type Element

type Element struct {
	Score float64
	Value interface{}
	// contains filtered or unexported fields
}

func (*Element) Next

func (e *Element) Next() *Element

type ListObj

type ListObj struct {
	// contains filtered or unexported fields
}

func ListInstance

func ListInstance() *ListObj

func (*ListObj) Append

func (this *ListObj) Append(data interface{}) bool

尾部压入数据

func (*ListObj) Delete

func (this *ListObj) Delete(index uint) bool

func (*ListObj) Find

func (this *ListObj) Find(data interface{}) *Node

* * 查找链表中的元素

func (*ListObj) Get

func (this *ListObj) Get(index uint) *Node

func (*ListObj) Insert

func (this *ListObj) Insert(index uint, data interface{}) bool

type Node

type Node struct {
	// contains filtered or unexported fields
}

type NodeStruct

type NodeStruct struct {
	// contains filtered or unexported fields
}

func NodeInstance

func NodeInstance(key []byte, value []byte) *NodeStruct

func (*NodeStruct) GetData

func (this *NodeStruct) GetData() []byte

func (*NodeStruct) GetName

func (this *NodeStruct) GetName() []byte

func (*NodeStruct) UpdateData

func (this *NodeStruct) UpdateData(value []byte) *NodeStruct

type SkipList

type SkipList struct {
	// contains filtered or unexported fields
}

func New

func New() *SkipList

func (*SkipList) Delete

func (sl *SkipList) Delete(score float64) *Element

func (*SkipList) Front

func (sl *SkipList) Front() *Element

func (*SkipList) Insert

func (sl *SkipList) Insert(score float64, value interface{}) *Element

func (*SkipList) Search

func (sl *SkipList) Search(score float64) (element *Element, ok bool)

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func StackInstance

func StackInstance() *Stack

func (*Stack) Len

func (this *Stack) Len() int

func (*Stack) Peek

func (this *Stack) Peek() interface{}

func (*Stack) Pop

func (this *Stack) Pop() interface{}

func (*Stack) Push

func (this *Stack) Push(value interface{}) bool

type TreeStruct

type TreeStruct struct {
	// contains filtered or unexported fields
}

func TreeInstance

func TreeInstance() *TreeStruct

func (*TreeStruct) GetChildren

func (this *TreeStruct) GetChildren() []*TreeStruct

func (*TreeStruct) GetHight

func (this *TreeStruct) GetHight() int

func (*TreeStruct) GetNode

func (this *TreeStruct) GetNode() []*NodeStruct

func (*TreeStruct) GetParent

func (this *TreeStruct) GetParent() *TreeStruct

* *last node data

func (*TreeStruct) GetRoot

func (this *TreeStruct) GetRoot() *TreeStruct

func (*TreeStruct) IsLeaf

func (this *TreeStruct) IsLeaf() bool

func (*TreeStruct) IsRoot

func (this *TreeStruct) IsRoot() bool

func (*TreeStruct) SetChildren

func (this *TreeStruct) SetChildren(children *TreeStruct) *TreeStruct

func (*TreeStruct) SetHight

func (this *TreeStruct) SetHight(hight int) *TreeStruct

func (*TreeStruct) SetNode

func (this *TreeStruct) SetNode(node *NodeStruct) *TreeStruct

func (*TreeStruct) SetParent

func (this *TreeStruct) SetParent(tree *TreeStruct) *TreeStruct

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

func NewTrie

func NewTrie() *Trie

func (*Trie) Find

func (t *Trie) Find(word string) bool

func (*Trie) Insert

func (t *Trie) Insert(word string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL