Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct { Node // contains filtered or unexported fields }
Element is a kind of node with key-value data
type Option ¶
type Option func(option *Options)
Option is a function used to set Options
func WithGoroutineSafe ¶
func WithGoroutineSafe() Option
WithGoroutineSafe sets Skiplist goroutine-safety,
func WithKeyComparator ¶
func WithKeyComparator(cmp comparator.Comparator) Option
WithKeyComparator sets Key comparator option
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options holds Skiplist's options
type Skiplist ¶
type Skiplist struct {
// contains filtered or unexported fields
}
Skiplist is a kind of data structure which can search quickly by exchanging space for time
func (*Skiplist) Get ¶
func (sl *Skiplist) Get(key interface{}) interface{}
Get returns the value associated with the passed key if the key is in the skiplist, otherwise returns nil
func (*Skiplist) Insert ¶
func (sl *Skiplist) Insert(key, value interface{})
Insert inserts a key-value pair into the skiplist
func (*Skiplist) Keys ¶
func (sl *Skiplist) Keys() []interface{}
Keys returns all keys in the skiplist
Click to show internal directories.
Click to hide internal directories.