Question:

Which of the following are applications of stack?
A. Print commands from multiple files from the same computer
B. Bangles worn on wrist
C. Multiple chairs in a vertical pile
D. Pile of clothes in an almirah
Choose the correct answer from the options given below:

Show Hint

To check if a real-life example is a stack:
Ask yourself, "Can I access or remove the first element placed without removing everything on top of it?"
If you must remove the top items first, it is a Stack (LIFO)!
Updated On: Jun 11, 2026
  • A, B and D only
  • A, C and D only
  • A, B, C and D
  • B, C and D only
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation


Step 1: Understanding the Question:

The question asks to identify which of the listed real-world scenarios (A, B, C, D) are correct representations or applications of the Stack (LIFO) data structure.

Step 2: Stack vs Queue Behavioral Rules:

- Stack (Last-In, First-Out LIFO): The item that is added last is the first one to be removed.
- Queue (First-In, First-Out FIFO): The item added first is processed first.

Step 3: Analysis of Scenarios:

- A. Print commands from multiple files: When multiple documents are sent to a printer, they are processed in the order they were received. This represents a print queue working on a First-In, First-Out (FIFO) basis. Thus, it is an application of a Queue, not a stack.
- B. Bangles worn on wrist: When removing bangles, the bangle worn last (closest to the hand) must be removed first, while the first bangle worn is removed last. This follows LIFO, representing a Stack.
- C. Multiple chairs in a vertical pile: When stacking chairs, the last chair added to the top of the pile is the first one you can remove. This follows LIFO, representing a Stack.
- D. Pile of clothes in an almirah: When clothes are folded and piled, the piece placed on the top of the pile (last added) is the first one taken. This follows LIFO, representing a Stack.
- Therefore, only B, C, and D are applications of a stack.

Step 4: Final Answer:

The applications of a stack are B, C, and D only.
Hence, option (D) is the correct choice.
Was this answer helpful?
0
0