Differentiation between Stack and Queue

Write down the differentiation between a stack and a Queue?

E

Expert

Verified

Stack – Represents collection of elements in Last in First Out order.

Operations consists of testing null stack, finding out the top element in stack, removal of top most element and adding elements on top of stack.

Queue - Represents collection of elements in First in First Out order.

Operations consist of testing null queue, finding out the next element, removal of elements and inserting elements from queue.

Insertion of elements is at end of queue

Deletion of elements is from starting of the queue.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.