pt

package module
v0.0.0-...-3b00767 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeFor

func TypeFor[T any]() reflect.Type

TypeFor returns the [Type] that represents the type argument T. copy from the std library

Types

type Int

type Int int

func (Int) Compare

func (i Int) Compare(i2 Int) int

type Iter

type Iter[T Ordered[T]] struct {
	// contains filtered or unexported fields
}

func (*Iter[T]) Close

func (i *Iter[T]) Close()

func (*Iter[T]) Next

func (i *Iter[T]) Next() (ret T, ok bool)

func (*Iter[T]) Rewind

func (i *Iter[T]) Rewind()

func (*Iter[T]) Seek

func (i *Iter[T]) Seek(pivot T) (ret T, ok bool)

type Ordered

type Ordered[T any] interface {
	Compare(T) int
}

type Treap

type Treap[T Ordered[T]] struct {
	// contains filtered or unexported fields
}

func NewTreap

func NewTreap[T Ordered[T]]() *Treap[T]

func (*Treap[T]) BulkDelete

func (t *Treap[T]) BulkDelete(values []T)

func (*Treap[T]) BulkUpsert

func (t *Treap[T]) BulkUpsert(values []T)

func (*Treap[T]) Copy

func (t *Treap[T]) Copy() *Treap[T]

func (*Treap[T]) Delete

func (t *Treap[T]) Delete(value T) (deleted bool)

func (*Treap[T]) Get

func (t *Treap[T]) Get(pivot T) (ret T, ok bool)

func (*Treap[T]) Length

func (t *Treap[T]) Length() int

func (*Treap[T]) NewIter

func (t *Treap[T]) NewIter() *Iter[T]

func (*Treap[T]) Union

func (t *Treap[T]) Union(t2 *Treap[T])

func (*Treap[T]) Upsert

func (t *Treap[T]) Upsert(value T) (existed bool)

Jump to

Keyboard shortcuts

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