minstack

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinStack

type MinStack[T any] struct {
	// contains filtered or unexported fields
}

MinStack defines a type.

func NewMinStack

func NewMinStack[T any](less cmp.LessFunc[T]) MinStack[T]

NewMinStack creates a new instance.

func (*MinStack[T]) GetMin

func (ms *MinStack[T]) GetMin() T

GetMin returns the value.

func (*MinStack[T]) Pop

func (ms *MinStack[T]) Pop() (T, bool)

Pop removes or resets state.

func (*MinStack[T]) Push

func (ms *MinStack[T]) Push(x T)

Push updates or inserts a value.

func (*MinStack[T]) Top

func (ms *MinStack[T]) Top() T

Top converts the value.

Jump to

Keyboard shortcuts

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