Computer Science, asked by jeetupainkra99, 2 months ago

what are the conditions under which operation on queue can take place ?
Define FIFO. mention it's connection with stak ​

Answers

Answered by vaishnavichaurasia89
0

Answer:

Conditions under which operation on queue can take place -

  1. Enqueue - It is used to insert elements into the queue. Insertion can only happen at the Rear Pointer if the queue is not full.
  2. Dequeue - It is used to delete an element from queue. Deletion can only happen at the Front pointer if the queue is not empty.

FIFO - Queue is a Linear Data Structure. It follows FIFO Principle.

FIFO stands for FIRST IN AND FIRST OUT.

Connection with Stack -

Stack follows the LIFO (LAST IN FIRST OUT) order whereas Queue follows the FIFO Principle.

Both are Linear Data structures.

Explanation:

To track the elements of Queue, there are 2 pointers -

  1. Front Pointer - Deletion takes place
  2. Rear Pointer - Insertion takes place.

Real-Life Example - Imagine 10 persons standing one after another in a queue in front of the ticket booking center.

Similar questions