Stack And Queue Question:
Download Questions PDF

Explain stacks and queues in detail?

Answer:

A stack is a data structure based on the principle Last In First Out. Stack is container to hold nodes and has two operations - push and pop. Push operation is to add nodes into the stack and pop operation is to delete nodes from the stack and returns the top most node.

A queue is a data structure based on the principle First in First Out. The nodes are kept in an order. A node is inserted from the rear of the queue and a node is deleted from the front. The first element inserted in the first element first to delete.

Download Stack And Queue Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how to implement queue using stack?Tell me what are priority queues?