gqueue

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 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 GQueue

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

func New

func New[T any](unsafe ...bool) *GQueue[T]

New 创建FIFO队列

func (*GQueue[T]) Front

func (q *GQueue[T]) Front() *T

Front 获取队列的第一个元素,不移除

func (*GQueue[T]) IsEmpty

func (q *GQueue[T]) IsEmpty() bool

IsEmpty 判断是否为空

func (*GQueue[T]) Last

func (q *GQueue[T]) Last() *T

Last 取队列最后一个元素,不移除

func (*GQueue[T]) Offer

func (q *GQueue[T]) Offer(item T)

Offer 入队列

func (*GQueue[T]) Peek

func (q *GQueue[T]) Peek() *T

Peek 出队列

func (*GQueue[T]) Size

func (q *GQueue[T]) Size() int

Size 获取队列的长度

Jump to

Keyboard shortcuts

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