queue

package
v0.0.0-...-a4a72b7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListQueue []any

Functions

func BackQueue

func BackQueue() any

BackQueue return the Back value

func DeQueue

func DeQueue() any

DeQueue it will be removed the first value that added into the list

func EnQueue

func EnQueue(n any)

EnQueue it will be added new value into our list

func FrontQueue

func FrontQueue() any

FrontQueue return the Front value

func IsEmptyQueue

func IsEmptyQueue() bool

IsEmptyQueue check our list is empty or not

func LenQueue

func LenQueue() int

LenQueue will return the length of the queue list

Types

type LQueue

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

LQueue will be store the value into the list

func (*LQueue) Back

func (lq *LQueue) Back() (any, error)

Back it will return the back value

func (*LQueue) Dequeue

func (lq *LQueue) Dequeue() error

Dequeue will be removed the first value that input (First In First Out - FIFO)

func (*LQueue) Empty

func (lq *LQueue) Empty() bool

Empty is check our list is empty or not

func (*LQueue) Enqueue

func (lq *LQueue) Enqueue(value any)

Enqueue will be added new value

func (*LQueue) Front

func (lq *LQueue) Front() (any, error)

Front it will return the front value

func (*LQueue) Len

func (lq *LQueue) Len() int

Len it will return the length of list

type Node

type Node struct {
	Data any
	Next *Node
}

Node will be store the value and the next node as well

type Queue

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

Queue structure is tell us what our head is and what tail should be with length of the list

Jump to

Keyboard shortcuts

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