English

Write an algorithm to implement pop operation.

Advertisements
Advertisements

Question

Write an algorithm to implement pop operation.

Very Short Answer
Advertisements

Solution

  1. Start.
  2. If top = -1, print Stack Empty and stop.
  3. Store stack[top] as the deleted item.
  4. Decrement top 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 21. | Page 123
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×