English

Write an algorithm to implement deletion operation of queue.

Advertisements
Advertisements

Question

Write an algorithm to implement deletion operation of queue.

Very Short Answer
Advertisements

Solution

  1. Start.
  2. If front = -1, print Queue Empty and stop.
  3. Store queue[front] as the deleted item.
  4. If front = rear, set both to -1; otherwise increment front by 1.
  5. Print Item Deleted.
  6. Stop.
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Stacks & Queues in list - EXERCISE [Page 123]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 6 Stacks & Queues in list
EXERCISE | Q 23. | Page 123
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×