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.