Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.33 KB

File metadata and controls

32 lines (20 loc) · 1.33 KB

Definition –

Queue is a linear data structure which operates in a First IN First OUT or Last IN Last OUT. Queue is an abstract data type with a bounded (predefined) capacity. It is a simple data structure that allows adding and removing elements in a particular order. The order is FIFO(First IN First OUT) or LILO(Last In Last Out).

It is named queue as it behaves like a real-world queue for examples –

  • queue(line) of cars in a single lane,
  • queue of people waiting at food counter etc.

Standard Queue Operations –

  • Enqueue() – Add item to the queue from the REAR.
  • Dequeue() – Remove item from the queue from the FRONT.
  • isFull() – Check if queue is full or not.
  • isEmpty() – Check if queue empty or not.
  • count() – Get number of items in the queue.
  • peek() – return front elemenet in the queue(line).

Step 2: Visualize pseudocode

Thank You