skipmap

package
v0.0.0-...-bed99cc Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxLevel    = 32
	DefaultProbability = 0.5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node[K any, V any] struct {
	// contains filtered or unexported fields
}

type SkipMap

type SkipMap[K any, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K cmp.Ordered, V any]() *SkipMap[K, V]

func NewWithComparator

func NewWithComparator[K any, V any](comparator func(a, b K) int) *SkipMap[K, V]

func (*SkipMap[K, V]) Get

func (s *SkipMap[K, V]) Get(key K) (V, bool)

func (*SkipMap[K, V]) IsEmpty

func (s *SkipMap[K, V]) IsEmpty() bool

func (*SkipMap[K, V]) Len

func (s *SkipMap[K, V]) Len() int

func (*SkipMap[K, V]) Max

func (s *SkipMap[K, V]) Max() (K, V, bool)

func (*SkipMap[K, V]) Min

func (s *SkipMap[K, V]) Min() (K, V, bool)

func (*SkipMap[K, V]) Put

func (s *SkipMap[K, V]) Put(key K, value V)

func (*SkipMap[K, V]) Range

func (s *SkipMap[K, V]) Range(start, end K) []V

func (*SkipMap[K, V]) RangeFunc

func (s *SkipMap[K, V]) RangeFunc(start, end K, f func(key K, value V) bool)

RangeFunc iterates over the elements in the range [start, end] and calls f for each key-value pair. If f returns false, iteration stops.

func (*SkipMap[K, V]) Remove

func (s *SkipMap[K, V]) Remove(key K) bool

Jump to

Keyboard shortcuts

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