queue

package
v0.0.0-...-a9cb292 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue []interface{}

Queue 支持任何类型的队列

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

IsEmpty 判断队列是否为空

func (*Queue) Popo

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

Popo 删除任何类型,并返回删除元素

Example
q := Queue{1}
q.Push(2)
q.Push(3)
fmt.Println(q.Popo())
fmt.Println(q.Popo())
fmt.Println(q.IsEmpty())

fmt.Println(q.Popo())
fmt.Println(q.IsEmpty())
Output:

1
2
false
3
true

func (*Queue) PopoInt

func (q *Queue) PopoInt() int

PopoInt 删除 int 并返回 int

func (*Queue) Push

func (q *Queue) Push(value interface{})

Push 添加任何类型元素至队列

func (*Queue) PushInt

func (q *Queue) PushInt(v int)

PushInt 只能添加 int 类型

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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