sorted_list

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SortedList

type SortedList struct {
	// contains filtered or unexported fields
}

func NewSortedList

func NewSortedList() *SortedList

func (*SortedList) Delete

func (sl *SortedList) Delete(key int64)

Delete removes one occurrence of key if present.

func (*SortedList) GetByIndex

func (sl *SortedList) GetByIndex(index int) (int64, bool)

GetByIndex returns the key stored at a 0-based position.

func (*SortedList) Insert

func (sl *SortedList) Insert(key int64)

Insert adds a key occurrence to the structure.

func (*SortedList) Keys

func (sl *SortedList) Keys() []int64

Keys returns all keys in ascending order, including duplicates.

func (*SortedList) Len

func (sl *SortedList) Len() int

func (*SortedList) Merge

func (sl *SortedList) Merge(other *SortedList)

Merge inserts all keys from other into this sorted list.

Jump to

Keyboard shortcuts

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