DocMCQs Educational Banner

Which of the following is not the application of stack?

Question: Which of the following is not the application of stack?
  • A. a) Data Transfer between two asynchronous process βœ“
  • B. b) Compiler Syntax Analyzer
  • C. c) Tracking of local variables at run time
  • D. d) A parentheses balancing program
Correct Answer: A. a) Data Transfer between two asynchronous process
Explanation: Stacks follow LIFO (Last In, First Out) principle: This means the last element added is the first one to be removed.

Data transfer between asynchronous processes requires a FIFO (First In, First Out) structure, where the first element added is the first one to be removed.

Queues are the ideal data structure for this purpose, as they adhere to the FIFO principle.

Other options:

b) Compiler Syntax Analyzer: Stacks are used extensively in compilers for parsing expressions and checking for syntax errors.

c) Tracking of local variables at run time: Function calls and their corresponding local variables are managed using stacks.

d) A parentheses balancing program: As we discussed earlier, stacks are essential for checking the balance of parentheses in an expression.

Therefore, while stacks are crucial for many applications, they are not suitable for data transfer between asynchronous processes.

Leave a Comment

Your email address will not be published. Required fields are marked *

Join Our WhatsApp Channel ×
Scroll to Top