


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Prof. Balamohan Pawar delivered this lecture at Allahabad University for Aeronautical Engineering and Computer Programming course. Its main points are: Palindrome, String, Equality, Postfix, Infix, End, For, Loop, Process, Loop
Typology: Slides
1 / 4
This page cannot be seen from the preview
Don't miss anything!



3
same both forward and backward x y z a z y x lb ub
4
Read from left to right:
the stack (the first number popped is the second binary operand)
push the result back onto the stack
on top of stack is the answer
5 3 + 10 *
5 3 + 4 + 1 +
5
post_fix := โโ Create(Op_Stack) for I in 1 .. Length loop If Is_Operand(expr(I)) = true then Append(post_fix, expr(I))
If Is_Operator(expr(I)) = true then Process_Next_Operator(expr(I)) end loop
6
Done := False loop If Is_Empty(Op_Stack) or next_op is โ(โ, set Done to True Elsif precedence(next_op) > precedence(top_operator) Push next_op onto Op_stack-- ensures higher precedence operators evaluated first Set Done to True Else Pop the operator_stack If operator popped is โ(โ set Done to True Else Done = True
-- string post_fix has the result
push next_op onto Op_Stack
append operator popped to post_fix string exit when end loop
9
Infix Expression 3 + 5 * โ 6 โ 7 * (8 + 5)
Postfix Expression