queue

package
v0.7.14 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 3 Imported by: 0

README

简单实现的一个队列,目前支持的元素是 int64

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
}

简易实现队列

func NewQueue

func NewQueue() *Queue

func (*Queue) All

func (q *Queue) All() []int64

获取 queue 中的所有元素

func (*Queue) Length

func (q *Queue) Length() int

func (*Queue) Pop

func (q *Queue) Pop() (int64, error)

func (*Queue) Push

func (q *Queue) Push(num int64)

func (*Queue) Remove

func (q *Queue) Remove(num int64, all bool) int

all: 是否删除队列里所有的这个元素 返回删除了多少元素

Jump to

Keyboard shortcuts

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