deque

package
v0.0.0-...-db1a295 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deque

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

func NewDeque

func NewDeque() *Deque

func (*Deque) Append

func (dq *Deque) Append(v interface{}) bool

Append 从右边添加元素, return是否添加成功

func (*Deque) Empty

func (dq *Deque) Empty() bool

Empty 是否为空

func (*Deque) Head

func (dq *Deque) Head() interface{}

Head 获取最左边元素

func (*Deque) LAppend

func (dq *Deque) LAppend(v interface{}) bool

LAppend 从左边添加元素, return是否添加成功

func (*Deque) LPop

func (dq *Deque) LPop() (interface{}, bool)

LPop 从左边移除元素, return元素值、是否移除成功

func (*Deque) Len

func (dq *Deque) Len() int

Len 当前队列长度

func (*Deque) Pop

func (dq *Deque) Pop() (interface{}, bool)

Pop 从右边移除元素, return元素值、是否移除成功

func (*Deque) Tail

func (dq *Deque) Tail() interface{}

Tail 获取最右边元素

Jump to

Keyboard shortcuts

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