leetcode

package
v0.0.0-...-fdcae39 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyCircularQueue

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

MyCircularQueue ...

func Constructor

func Constructor(k int) MyCircularQueue

Constructor initialize your data structure here. Set the size of the queue to be k

func (*MyCircularQueue) DeQueue

func (q *MyCircularQueue) DeQueue() bool

DeQueue delete an element from the circular queue. Return true if the operation is successful

func (*MyCircularQueue) EnQueue

func (q *MyCircularQueue) EnQueue(value int) bool

EnQueue insert an element into the circular queue. Return true if the operation is successful

func (*MyCircularQueue) Front

func (q *MyCircularQueue) Front() int

Front get the front item from the queue

func (*MyCircularQueue) IsEmpty

func (q *MyCircularQueue) IsEmpty() bool

IsEmpty checks whether the circular queue is empty or not

func (*MyCircularQueue) IsFull

func (q *MyCircularQueue) IsFull() bool

IsFull checks whether the circular queue is full or not

func (*MyCircularQueue) Rear

func (q *MyCircularQueue) Rear() int

Rear get the last item from the queue

Jump to

Keyboard shortcuts

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