Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Latest commit

 

History

History

Queue

Queue

  • Queue is a linear data structure that follows the FIFO (First-In-First-Out) policy.Meaning, one end is always used to insert data and the other is used to remove data.

Sub-Topics

Methods

Operation Description
Enqueue Add a new element
Dequeue Removes an element
Front Get the fist element
Rear Get the the last element
Size Returns the total number of elements

Time Complexity

Operation Complexity
Access O(n)
Search O(n)
Insertion O(1)
Deletion O(1)

Implementation

Using Linked List

Language View Code
c++ Github Raw
c Github Raw
cs Github Raw
php Github Raw

Using Array

Language Code
c++ Github Raw
c Github Raw
java Github Raw
js Github Raw
py Github Raw
cs Github Raw
rb Github Raw
php Github Raw
go Github Raw
scala Github Raw
swift Github Raw