Flat Preloader Icon

Queue

Overview

  1. what is Queue ?
  2. Operations on Queue.
  3. Ways to implement Queue.

What Is Queue?

  1. Queue is a linear data structure.
  2. Working principle of queue is first in first out.
  3. In slack only one end is open for insertion and deletion.
  4. In queue one end is for insertion and another end is for deletion.

  • Insertion is done on one end known as rear or back
  • Deletion is done on another end known as front

Real world Example:

Operations On Queue

  1. Insertion
  2. Deletion
  3. get front
  4. get back
  5. enqueue
  6. dequeue

Ways To Implement Queue

  1. using Array
  2. Using Dynamic Arrays
  3. using Linked List

Implementing Queue Using Arrays

Implementing Queue Using Linked List