circularqueue

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 1 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCircularQueue = errors.New("circular queue: fxxk")

Functions

This section is empty.

Types

type CircularQueue

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

func New

func New(capacity int) *CircularQueue

func (*CircularQueue) At

func (c *CircularQueue) At(i int) (interface{}, error)

获取第i个元素

func (*CircularQueue) Back

func (c *CircularQueue) Back() (interface{}, error)

@return 如果队列为空,则返回错误

func (*CircularQueue) Empty

func (c *CircularQueue) Empty() bool

func (*CircularQueue) Front

func (c *CircularQueue) Front() (interface{}, error)

@return 如果队列为空,则返回错误

func (*CircularQueue) Full

func (c *CircularQueue) Full() bool

func (*CircularQueue) PopFront

func (c *CircularQueue) PopFront() (interface{}, error)

@return 如果队列为空,则返回错误

func (*CircularQueue) PushBack

func (c *CircularQueue) PushBack(v interface{}) error

@return 如果队列满了,则返回错误

func (*CircularQueue) Size

func (c *CircularQueue) Size() int

Jump to

Keyboard shortcuts

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