They had asked a common Queue based question
Utilisateur anonyme
Common Question based on Queue: 1) what is queue? Queue is a linear data sturcture which follows the principle-LIFO(LAST IN FIRST OUT) Example: Waiting in a line for movie tickets( we stand in line at last and get tickets at front end and leave) 2)Basic operations in Queue: 1)Enqueue- Add the element at Rear end 2)Dequeue- remove element at front end 3) peek- returns the topmost element in front end and does not remove it 4) isFull()- check whether queue is full or not 5) isEmpty()- check whether queue is empty 3) Types of Queue: 1) Simple Queue- as like principle (LIFO) 2) Circular Queue- last element is connected to first element so that the drawback of simple queue is resolved 3)Priority Queue- add or remove element at any place based on priority of max heap or min heap values 4)Double ended Queue- add or remove element at both ends