containers

package
v0.0.0-...-e9a78ef Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heap

type Heap[C cmp.Ordered] interface {
	Len() int
	Less(i, j int) bool
	Swap(i, j int)
	Push(x any)
	Pop() any
}

func NewMaxHeap

func NewMaxHeap[C cmp.Ordered]() Heap[C]

func NewMinHeap

func NewMinHeap[C cmp.Ordered]() Heap[C]

type MaxHeap

type MaxHeap[C cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func (*MaxHeap[C]) Len

func (m *MaxHeap[C]) Len() int

func (*MaxHeap[C]) Less

func (m *MaxHeap[C]) Less(i, j int) bool

func (*MaxHeap[C]) Pop

func (m *MaxHeap[C]) Pop() any

func (*MaxHeap[C]) Push

func (m *MaxHeap[C]) Push(x any)

func (*MaxHeap[C]) Swap

func (m *MaxHeap[C]) Swap(i, j int)

type MinHeap

type MinHeap[C cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func (*MinHeap[C]) Len

func (m *MinHeap[C]) Len() int

func (*MinHeap[C]) Less

func (m *MinHeap[C]) Less(i, j int) bool

func (*MinHeap[C]) Pop

func (m *MinHeap[C]) Pop() any

func (*MinHeap[C]) Push

func (m *MinHeap[C]) Push(x any)

func (*MinHeap[C]) Swap

func (m *MinHeap[C]) Swap(i, j int)

type Queue

type Queue[C any] interface {
	Enqueue(value C)
	Dequeue() (C, error)
	Peek() (C, error)
	Size() int
}

func NewQueue

func NewQueue[C any]() Queue[C]

type Stack

type Stack[C cmp.Ordered] interface {
	Push(value C)
	Pop() (C, error)
	Peek() (C, error)
	Size() int
}

func NewStack

func NewStack[C cmp.Ordered]() Stack[C]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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