ds

package
v0.0.0-...-8e8c7aa Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 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 Slice

type Slice[T any] []T

Slice is a wrapper around a Go's built-in slice type. It provides a couple of helper functions that make it easier to satisfy interfaces such as sort.Interface and heap.Interface.

func (Slice[T]) Len

func (s Slice[T]) Len() int

Len returns the length of the slice.

func (*Slice[T]) Pop

func (s *Slice[T]) Pop() any

Pop an element from the tail of the slice. The element in the slice is set to zero, so that any objects that were references by it may be garbage collected.

func (*Slice[T]) Push

func (s *Slice[T]) Push(x any)

Push a new element to the tail of the slice.

func (Slice[T]) Swap

func (s Slice[T]) Swap(i, j int)

Swap two elements contained in the slice.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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