Home Reference Source
import {Queue} from 'dsa-gfg/src/queue/queue.ts'
public class | source

Queue

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

arr: *

public
public

Method Summary

Public Methods
public

add(a: T)

The method add to push element into the queue

public

The method to check if queue is empty or not

public

poll(): *

The method pop which return the element poped out of the queue

public

reverse(): *

This function Reverses a Queue

public

The method to return size of the queue

public

values(): *

This function return the values of the queue

Public Constructors

public constructor() source

Public Members

public arr: * source

public front: number source

public rear: number source

Public Methods

public add(a: T) source

The method add to push element into the queue

Params:

NameTypeAttributeDescription
a T

public isEmpty(): boolean source

The method to check if queue is empty or not

Return:

boolean

public poll(): * source

The method pop which return the element poped out of the queue

Return:

*

public reverse(): * source

This function Reverses a Queue

Return:

*

public size(): number source

The method to return size of the queue

Return:

number

public values(): * source

This function return the values of the queue

Return:

*