Docsity

Convert Infix Expression to Postfix & Evaluate: Data Structure & Algorithms Assignment 4, Assignments of Computer Science

Toggle sidebar
bg1
Department of Computer Science
Assignment No. 4, November 2020 [Total Marks 25]
Instructor: Samreen Ishfaq Data Structure & Algorithms BSCS 3 Afternoon
Student Name: _________________ Roll No: ____________________
Student Name: _________________ Roll No: ____________________
Student Name: _________________ Roll No: ____________________
Student Name: _________________ Roll No: ____________________
Student Name: _________________ Roll No: ____________________
This assignment is due on 4th November, 2020. The solution to the assignment must be submitted in
class in the form of hardcopy. This page will be the front page of your assignment, you have to
write your group member names and registration numbers on it. Late submission is not
acceptable.
Write a program to convert infix expression into postfix and evaluate it. Use
stack for this purpose.
1. Get Input (Infix Expression ((4+5) *3)) 5
2. Infix into Postfix Conversion ( 45+3* ) 7
3. Postfix Evaluation ( 27) 7
4. Exit 1
5. Viva /Demo 5
Good Luck ☺

Partial preview of the text

Download Convert Infix Expression to Postfix & Evaluate: Data Structure & Algorithms Assignment 4 and more Assignments Computer Science in PDF only on Docsity!

Department of Computer Science Assignment No. 4, November 2020 [ Total Marks 25] Instructor: Samreen Ishfaq Data Structure & Algorithms BSCS 3 Afternoon Student Name: _________________ Roll No: ____________________ Student Name: _________________ Roll No: ____________________ Student Name: _________________ Roll No: ____________________ Student Name: _________________ Roll No: ____________________ Student Name: _________________ Roll No: ____________________ This assignment is due on 4 th^ November, 2020. The solution to the assignment must be submitted in class in the form of hardcopy. This page will be the front page of your assignment, you have to write your group member names and registration numbers on it. Late submission is not acceptable.

Write a program to convert infix expression into postfix and evaluate it. Use

stack for this purpose.

1. Get Input (Infix Expression ((4+5) * 3 )) 5

2. Infix into Postfix Conversion ( 45+3* ) 7

3. Postfix Evaluation ( 27 ) 7

4. Exit 1

5. Viva /Demo 5

Good Luck ☺