list

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FactorP  = float32(0.25) // level i 上的结点 有FactorP的比例出现在level i + 1上
	MaxLevel = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SkipList

type SkipList[T any] struct {
	// contains filtered or unexported fields
}

func NewSkipList

func NewSkipList[T any](compare ekit.Comparator[T]) *SkipList[T]

func NewSkipListFromSlice

func NewSkipListFromSlice[T any](slice []T, compare ekit.Comparator[T]) *SkipList[T]

func (*SkipList[T]) AsSlice

func (sl *SkipList[T]) AsSlice() []T

func (*SkipList[T]) DeleteElement

func (sl *SkipList[T]) DeleteElement(target T) bool

func (*SkipList[T]) Get

func (sl *SkipList[T]) Get(index int) (T, error)

func (*SkipList[T]) Insert

func (sl *SkipList[T]) Insert(Val T)

func (*SkipList[T]) Len

func (sl *SkipList[T]) Len() int

func (*SkipList[T]) Peek

func (sl *SkipList[T]) Peek() (T, error)

func (*SkipList[T]) Search

func (sl *SkipList[T]) Search(target T) bool

Jump to

Keyboard shortcuts

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