CUET PG 2024 Computer PYQ — Which of the following is not an application of Stack?… | Mathem Solvex | Mathem Solvex
Tip:A–D to answerE for explanationV for videoS to reveal answer
CUET PG 2024 — Computer PYQ
CUET PG | Computer | 2024
Which of the following is not an application of Stack?
Choose the correct answer:
A.
Tower of Hanoi
B.
Recursion
C.
Voter polling station
(Correct Answer)
D.
Parantheses Matching
Correct Answer:
Voter polling station
Explanation
- A stack is a linear data structure that follows the Last In First Out (LIFO) principle, where the most recently added element is the first to be removed. - Stacks are widely used in various applications such as recursion, balancing symbols (parentheses matching), and in algorithm implementations like the Tower of Hanoi. - Recursion uses the call stack to keep track of function calls, enabling the function to return to the correct point after the call is completed. - Parentheses matching is another common application where a stack is used to ensure that each opening parenthesis has a corresponding closing parenthesis.
Explanation
- A stack is a linear data structure that follows the Last In First Out (LIFO) principle, where the most recently added element is the first to be removed. - Stacks are widely used in various applications such as recursion, balancing symbols (parentheses matching), and in algorithm implementations like the Tower of Hanoi. - Recursion uses the call stack to keep track of function calls, enabling the function to return to the correct point after the call is completed. - Parentheses matching is another common application where a stack is used to ensure that each opening parenthesis has a corresponding closing parenthesis.