Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CircularQueue

A circular shape of queue which follows first in first out.

Examples

const { CircularQueue } = require('dsajs');
// or 
// import { CircularQueue } from 'dsajs';

let ds = new CircularQueue();

Hierarchy

  • CircularQueue

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Private _

_: any[]

Private _first

_first: number

Private _last

_last: number

Private _size

_size: number

Accessors

size

  • get size(): number

Methods

dequeue

  • dequeue(): any
  • Remove the first element from queue if one exists

    Returns any

    an element of queue or undefined if queue is empty

enqueue

  • enqueue(element: any): void

isEmpty

  • isEmpty(): boolean

isFull

  • isFull(): boolean

peek

  • peek(): any
  • Peek the first element of queue without removing it from queue

    Returns any

    an element of queue or undefined if queue is empty

Generated using TypeDoc