ds

package
v2.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 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 Queue

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

Queue 队列

func NewQueue

func NewQueue() *Queue

NewQueue Create a new queue

func (*Queue) Any

func (q *Queue) Any() bool

Any 返回true队列不为空

func (*Queue) Len

func (q *Queue) Len() int

Len 获取队列长度

func (*Queue) Peek

func (q *Queue) Peek() any

Peek 返回队列顶端元素

func (*Queue) Pop

func (q *Queue) Pop() any

Pop 出队操作

func (*Queue) Push

func (q *Queue) Push(v any)

Push 入队操作

func (*Queue) Range

func (q *Queue) Range(handler func(item any))

Range 从头开始遍历

func (*Queue) RangePop

func (q *Queue) RangePop(handler func(item any) bool)

RangePop 从头开始遍历

func (*Queue) RangePopMax

func (q *Queue) RangePopMax(max int, handler func(item any) bool)

RangePopMax 从头开始遍历,限制最大数量

func (*Queue) Rear

func (q *Queue) Rear() any

Rear 返回队列尾端元素

func (*Queue) RearRange

func (q *Queue) RearRange(max int, handler func(item any))

RearRange 末尾遍历操作

Jump to

Keyboard shortcuts

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