xslices

package
v0.0.0-...-9137e4d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[S ~[]E, E comparable](s S, v E) bool

func Difference

func Difference[T comparable](a, b []T) []T

Difference 计算差集

func DropDuplicate

func DropDuplicate[T comparable](s []T) []T

DropDuplicate 删除重复项

func Intersection

func Intersection[T comparable](a, b []T) []T

Intersection 计算交集

Types

type Stack

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

func NewStack

func NewStack[T any](items ...T) *Stack[T]

func (*Stack[T]) Get

func (s *Stack[T]) Get() T

Get 弹出一个元素,并且立即加入栈尾部

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() T

Pop 弹出一个元素

func (*Stack[T]) Push

func (s *Stack[T]) Push(item T)

Push 入栈

Jump to

Keyboard shortcuts

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