Societe Generale Written Test Qs.(Data Structures) :: Queue - Discussion
87 / 224
6, 8, 4, 3, and 1 are inserted into a data structure in that order. An item is deleted using only a basic data structure operation. If the deleted item is a 1, the data structure cannot be a ?
option C is correct. 1 is added at the last and deleted the first.following the concept of lifo stack is the answer
Asked In ::
Actually, in question, it has been asked can not be. LIFO is the stack , so the stack is possible, However, the queue is not possible because queue follows FIFO.
As here 1 is added in last and deleted first so Stack is possible, but queue can not be. So option A is correct.