English

Compare and contrast queue with stack. - Computer Science (Python)

Advertisements
Advertisements

Question

Compare and contrast queue with stack.

Short Note

Solution

  1. Queue support FIFO while Stack support LIFO.
  2. In Queue, Insertion occurs at the rear end and deletion at the end. While in Stack, Insertion and Deletion at one end only i.e. top.
  3. In Queue, Enqueue for element insertion, while in Stack, PUSH for element insertion.
  4. In Queue, Dequeue for element deletion, while in Stack, POP for element deletioni.
  5. Queues can be implement in several ways like Circular Queue, Doubly ended queue (deque), while Stack is implemented in one way only.
shaalaa.com
  Is there an error in this question or solution?
Chapter 4: Queue - Exercise [Page 65]

APPEARS IN

NCERT Computer Science [English] Class 12
Chapter 4 Queue
Exercise | Q 2. | Page 65
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×