Which of the following applications may use a stack? (a) Parenthesis balancing program (b) Process scheduling operating system (c) Conversion of infix arithmetic expression to postfix form
Which of the following applications may use a stack? (a) Parenthesis balancing program (b) Process scheduling operating system (c) Conversion of infix arithmetic expression to postfix form Correct Answer (a) and (c)
Stack:
- Stack is a data structure which possesses the LIFO property i.e. last in first out. The element which inserted at the last will come out first from the stack.
- Two operations that can be performed on the stack are Push and Pop.
- Push is used to insert element into the stack and pop operation is used to remove element from the top of the stack.
Applications of stack:
1) Expression conversion such as infix to postfix, infix to prefix.
2) Expression evaluation
3) Parsing well-formed parenthesis
4) Decimal to binary conversion
5) Reversing a string
6) Storing function calls
Note:
Queue data structure is used for process scheduling operating system.
মোঃ আরিফুল ইসলাম
Feb 20, 2025