queue

package
v0.0.0-...-51178b5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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 IQueue

type IQueue[T interface{}] interface {
	First() T
	Last() T
}

type Queue

type Queue[T interface{}] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T interface{}](length ...int) *Queue[T]

func (*Queue[T]) AddFirst

func (q *Queue[T]) AddFirst(v T) *Queue[T]

队列开头添加新的元素

func (*Queue[T]) AddLast

func (q *Queue[T]) AddLast(v T) *Queue[T]

队列末尾添加新的元素

func (*Queue[T]) Chan

func (q *Queue[T]) Chan() chan IQueue[T]

func (*Queue[T]) First

func (q *Queue[T]) First() T

删除第一个元素并返回

func (*Queue[T]) Last

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

删除最后一个元素并返回

Jump to

Keyboard shortcuts

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