Documentation ¶
Index ¶
Constants ¶
View Source
const (
MAX_LEVEL = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesComparator ¶
type BytesComparator struct { }
func (*BytesComparator) Compare ¶
func (self *BytesComparator) Compare(a, b interface{}) int
type Comparator ¶
type Comparator interface { // NOTE: skiplist will be ascending order if a < b, otherwise descending Compare(interface{}, interface{}) int }
type IntComparator ¶
type IntComparator struct { }
func (*IntComparator) Compare ¶
func (self *IntComparator) Compare(a, b interface{}) int
type SkipList ¶
type SkipList struct { Header *SkipListNode Tail *SkipListNode Length int MaxLevel int Level int Comparator Comparator }
func NewSkipList ¶
func NewSkipList(c Comparator) *SkipList
func (*SkipList) Iterator ¶
func (self *SkipList) Iterator() *SkipListIterator
type SkipListIterator ¶
type SkipListIterator struct { Node *SkipListNode Parent *SkipList }
func (*SkipListIterator) Key ¶
func (self *SkipListIterator) Key() interface{}
func (*SkipListIterator) Next ¶
func (self *SkipListIterator) Next()
func (*SkipListIterator) Rewind ¶
func (self *SkipListIterator) Rewind()
func (*SkipListIterator) Seek ¶
func (self *SkipListIterator) Seek(score interface{})
func (*SkipListIterator) Valid ¶
func (self *SkipListIterator) Valid() bool
func (*SkipListIterator) Value ¶
func (self *SkipListIterator) Value() interface{}
type SkipListLevel ¶
type SkipListLevel struct { Forward *SkipListNode Span int }
type SkipListNode ¶
type SkipListNode struct { Score interface{} Data interface{} Level map[int]*SkipListLevel }
func CreateSkiplistNode ¶
func CreateSkiplistNode(level int, score interface{}, data interface{}) (*SkipListNode, error)
type StringComparator ¶
type StringComparator struct { }
func (*StringComparator) Compare ¶
func (self *StringComparator) Compare(a, b interface{}) int
Click to show internal directories.
Click to hide internal directories.