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

QueueNodeImpl

This class is implementation of Queue using linked list

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

front: *

public

rear: *

Method Summary

Public Methods
public

add(a: T)

This function should add an item at rear

public

The method to check if queue is empty or not

public

poll(): *

This function should remove front item from queue and return the removed item

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 front: * source

public rear: * source

Public Methods

public add(a: T) source

This function should add an item at rear

Params:

NameTypeAttributeDescription
a T

public isEmpty(): boolean source

The method to check if queue is empty or not

Return:

boolean

public poll(): * source

This function should remove front item from queue and return the removed item

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:

*