queue

package
v0.0.0-...-b51443a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircularQueue

type CircularQueue struct {
	*ring.Ring
	// contains filtered or unexported fields
}

CircularQueue circular queue

func NewCircularQueue

func NewCircularQueue(n int) *CircularQueue

NewCircularQueue make a c

func (*CircularQueue) All

func (q *CircularQueue) All() []interface{}

All get all elements order from first to last, but not delete

func (*CircularQueue) AllInReverse

func (q *CircularQueue) AllInReverse() []interface{}

AllInReverse get all elements order from last to first, but not delete

func (*CircularQueue) Cap

func (q *CircularQueue) Cap() int

func (*CircularQueue) EnQueue

func (q *CircularQueue) EnQueue(data interface{})

EnQueue add a data to tail

func (*CircularQueue) IsEmpty

func (q *CircularQueue) IsEmpty() bool

IsEmpty judge a queue is empty

func (*CircularQueue) Len

func (q *CircularQueue) Len() int

type Queue

type Queue struct {
	*list.List
}

Queue keep to FIFO

func NewQueue

func NewQueue() *Queue

NewQueue new queue

func (*Queue) All

func (q *Queue) All() []interface{}

All get all elements order from first to last, but not delete

func (*Queue) AllInReverse

func (q *Queue) AllInReverse() []interface{}

AllInReverse get all elements order from last to first, but not delete

func (*Queue) DeQueue

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

DeQueue pop a data from head

func (*Queue) EnQueue

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

EnQueue add a data to tail

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

IsEmpty judge a queue is empty

Jump to

Keyboard shortcuts

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