Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 957 Bytes

queue.md

File metadata and controls

27 lines (18 loc) · 957 Bytes

Queue

1. Implement queue

Implement Queue

Description

[Easy] Queue is a linear collection of items where items are inserted and removed in a particular order. The queue is also called a FIFO Data Structure because it follows the “First In, First Out” principle i.e., the item that is inserted in the first is the one that is taken out first.

Implement queue data structure and its relevant methods:

  • queue() Add an element to the back of a queue.
  • dequeue() Remove an element from the top of a queue.
  • front() or peek() Return the value of the first element of a queue.
  • isEmpty() Return if the queue is empty.

Implementation

Back to index