queue

package
v0.0.0-...-d229d73 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 1 Imported by: 0

README

队列(Queue)

队列,又称为伫列(queue),是先进先出(FIFO, First-In-First-Out)的线性表。在具体应用中通常用链表或者数组来实现。队列只允许在后端(称为rear)进行插入操作,在前端(称为front)进行删除操作。 队列的操作方式和堆栈类似,唯一的区别在于队列只允许新数据在后端进行添加。

queue

Queue的golang实现

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Constructor

func Constructor() *Queue

func (*Queue) DeQueue

func (q *Queue) DeQueue() (element interface{})

func (*Queue) EnQueue

func (q *Queue) EnQueue(element interface{})

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Peek

func (q *Queue) Peek() interface{}

Jump to

Keyboard shortcuts

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