Assignment No. 03
Instructions:
1. The aim of this assignment is to give you initial understanding of the implementation of
Queue and Stack Data Structures.
2. You will have maximum marks if you have done all of the tasks.
3. Submit your assignment folder on Google Classroom in a single compressed (.zip, .rar)
folder. Folder should be named as RollNo_Assignment_No. It should contain:
1) .docx file containing codes. Paste all the required codes in the .docx file.
2) Perfectly working .exe files of your codes.
4. You can submit only electronic copy, hand written assignment would not be accepted.
5. Discussion among students is allowed but the final solution of the assignment should be
individual.
6. Cheating from others or the internet could result in zero marks in assignment to an F in
the course.
7. Deadline to submit this assignment is Wednesday, October 25, 2017 11:59 pm on
Google Classroom.
8. Late submission within 12 hours of the deadline will be penalized 50% of score. After
that submission will not be graded.
Question no. 1:
Write a code that evaluates an infix expression by converting it into a postfix expression. Your
code should print all the steps of:
You can refer to book page # 160 for precedence rules (You are required to implement your
code for only first three rows of table on page # 160, no need to implement logical operators).
Your code should work for the following and similar expressions:
1) A*B* (C/D+EF*G)/HI
2) A++ * B
3) A * B ++
4) A+B++
Question no. 2:
Implement Queue of a printer using circular array. It should have a simple user interface that
gives the user a choice between different operations that can be performed on the queue. For
example:
If I enter 2, it should ask for the input I want to insert in the queue. After adding the element it
should again provide me with the list of operations. This Time if I enter 1, it should print queue
with the new element added in it. It should perform (atleast) following operations:
Your program should be able to expand circular array if the isFull() function returns true.