Which of the following is not the application of stack?

a) Data Transfer between two asynchronous process
b) Compiler Syntax Analyzer
c) Tracking of local variables at run time
d) A parentheses balancing program

  • 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 *

Scroll to Top