skip_list

package
v0.0.0-...-212d8a0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const P = 0.75

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node[K cmp.Ordered, T any] struct {
	Value T
	Key   K
	Next  []*Node[K, T]
}

func (*Node[K, T]) Level

func (n *Node[K, T]) Level() int

func (*Node[K, T]) String

func (n *Node[K, T]) String() string

type SkipList

type SkipList[K cmp.Ordered, T any] struct {
	Head *Node[K, T]
}

func (*SkipList[K, T]) Debug

func (l *SkipList[K, T]) Debug()

func (*SkipList[K, T]) Delete

func (l *SkipList[K, T]) Delete(key K) bool

func (*SkipList[K, T]) Find

func (l *SkipList[K, T]) Find(key K) *T

func (*SkipList[K, T]) Insert

func (l *SkipList[K, T]) Insert(key K, value T)

Jump to

Keyboard shortcuts

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