type Comparer interface {
Less(x Comparer) bool
}
define int key like this
type KeyInt int
func (k KeyInt) Less(x Comparer) bool {
return k < x.(KeyInt)
}
- NewSkipList
- DeleteNode
- First, get the key like cpp
- Second, get the value like cpp
- Insert
- IsEmpty
- LowerBoundNode, find the lower bound node, like cpp map, key >= find key
- Search, SearchNode
- Key, get the key
- Value, get the value
- Next, the next node
- Prev, the prev node
- NewSkipListNode
- MaxLevel 32
- level i+1/level i = 0.25