Professional Documents
Culture Documents
Applications of Stack-By Asst Prof Praveen Yadav
Applications of Stack-By Asst Prof Praveen Yadav
UIT-RGPV
By:
Mr. Praveen Yadav
Assistant Professor
UIT-RGPV, Bhopal
Applications of Stack
• Stack Frames (Used in Recursion).
• Reversing a String.
• Parsing (Used in Compiler).
• Calculation of Postfix Expression.
P = 5, 6, 2, +, *, 12, 4, /, -
Solution:
First Add “)” at the end of P (Postfix expression)
P = 5, 6, 2, +, *, 12, 4, /, -, )
12 40, 12 Push 12
4 40, 12, 4 Push 4