English

Write an algorithm to implement insertion operation of queue.

Advertisements
Advertisements

Question

Write an algorithm to implement insertion operation of queue.

Very Short Answer
Advertisements

Solution

  1. Start.
  2. If both front and rear are -1, increment both by 1; otherwise increment rear by 1.
  3. Store the new element at queue[rear].
  4. Print Item Inserted.
  5. 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 22. | Page 123
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×