implement_queue_using_stacks

package
v0.0.0-...-6d07767 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyQueue

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

MyQueue 用栈实现队列的数据结构

func Constructor

func Constructor() MyQueue

Constructor 初始化数据结构

func (*MyQueue) Empty

func (q *MyQueue) Empty() bool

Empty 返回队列是否为空

func (*MyQueue) Peek

func (q *MyQueue) Peek() int

Peek 返回队列开头的元素

func (*MyQueue) Pop

func (q *MyQueue) Pop() int

Pop 从队列的开头移除并返回元素

func (*MyQueue) Push

func (q *MyQueue) Push(x int)

Push 将元素 x 推到队列的末尾

Jump to

Keyboard shortcuts

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