datastruct

package
v0.0.0-...-27f04c1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressBitsPerWord uint8          = 6
	WordsPerSize       document.DocId = 64
)
View Source
const (
	DefaultMaxLevel    = 12
	DefaultProbability = 0x3FFF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

type BitSet []document.DocId

func NewBitMap

func NewBitMap() *BitSet

func (*BitSet) Del

func (bs *BitSet) Del(bitIndex document.DocId)

func (*BitSet) IsExist

func (bs *BitSet) IsExist(bitIndex document.DocId) bool

func (*BitSet) IsFully

func (bs *BitSet) IsFully() bool

func (*BitSet) Set

func (bs *BitSet) Set(bitIndex document.DocId)

type Element

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

func ElementCopy

func ElementCopy(element *Element) (e *Element)

func (*Element) Key

func (e *Element) Key() document.DocId

func (*Element) Next

func (e *Element) Next(n int) *Element

func (*Element) Value

func (e *Element) Value() interface{}

type Iterator

type Iterator interface {
	HasNext() bool
	Next()
	Current() *Element
	GetGE(id document.DocId) *Element
}

type SkipList

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

func NewSkipList

func NewSkipList(level int) *SkipList

func (*SkipList) Add

func (sl *SkipList) Add(key document.DocId, value interface{})

func (*SkipList) Contains

func (sl *SkipList) Contains(key document.DocId) (ok bool)

func (*SkipList) Del

func (sl *SkipList) Del(key document.DocId)

func (*SkipList) Get

func (sl *SkipList) Get(key document.DocId) (x *Element, err error)

func (*SkipList) Iterator

func (sl *SkipList) Iterator() *SkipListIterator

func (*SkipList) Len

func (sl *SkipList) Len() int

type SkipListIterator

type SkipListIterator struct {
	Element   *Element
	FieldName string
}

func NewSkipListIterator

func NewSkipListIterator(element *Element) *SkipListIterator

func (*SkipListIterator) Current

func (si *SkipListIterator) Current() *Element

func (*SkipListIterator) GetGE

func (si *SkipListIterator) GetGE(key document.DocId) *Element

func (*SkipListIterator) GetLE

func (si *SkipListIterator) GetLE(key document.DocId) *Element

func (*SkipListIterator) HasNext

func (si *SkipListIterator) HasNext() bool

func (*SkipListIterator) Next

func (si *SkipListIterator) Next()

type Stack

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

func NewStack

func NewStack() *Stack

func (*Stack) Empty

func (s *Stack) Empty() bool

func (*Stack) Len

func (s *Stack) Len() int

func (*Stack) Peek

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

func (*Stack) Pop

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

func (*Stack) Push

func (s *Stack) Push(value interface{})

type TreeNode

type TreeNode struct {
	Data  interface{}
	Right *TreeNode
	Left  *TreeNode
}

func (*TreeNode) Print

func (treeNode *TreeNode) Print()

func (*TreeNode) To

func (treeNode *TreeNode) To() Stack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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