53) Stack A has the entries a, b, c (with a on top), Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of stack B can only be printed. In the arrangement, which of the following permutations of a, b, c is not possible?
Answer is:
c a b
Related Data structures and Algorithms MCQ with Answers
Answer is:
allocate resources (like CPU) by the operating system
Explanation:
Stacks cannot be used to allocate resources (like CPU) by the operating system.
However, stacks can be used for the other tasks listed:
- Stacks can be used to evaluate an arithmetic expression in postfix form by storing the operands in a stack and applying the operators in the correct order.
- Stacks can be used to implement recursion by storing the return addresses and local variables of each function call in a stack.
- Stacks can be used to convert a given arithmetic expression in infix form to its equivalent postfix form by applying the shunting yard algorithm or similar methods.
Answer is: