ringQueue

package
v0.0.0-...-532f4bb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingQueue

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

func InitRingQueue

func InitRingQueue(size int) *RingQueue

InitRingQueue 初始化环形队列

func (*RingQueue) Capacity

func (p *RingQueue) Capacity() int

Capacity 当前队列容量

func (*RingQueue) Dequeue

func (p *RingQueue) Dequeue() (interface{}, error)

Dequeue 出队

func (*RingQueue) Enqueue

func (p *RingQueue) Enqueue(elem interface{})

Enqueue 入队

func (*RingQueue) IsEmpty

func (p *RingQueue) IsEmpty() bool

IsEmpty 判断当前队列长度是否为空

func (*RingQueue) IsFull

func (p *RingQueue) IsFull() bool

IsFull 判断当前队列是否已满

func (*RingQueue) Length

func (p *RingQueue) Length() int

Length 当前队列长度

Jump to

Keyboard shortcuts

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