{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab6-StackProblems

# Lab6-StackProblems - A B C 1 44 – 15 9 3 2 12 A B C 2 12...

This preview shows page 1. Sign up to view the full content.

Computer Science I – Fall 2010 Recitation #6: Stack Applications – Infix/Postfix Convert the following INFIX expressions into POSTFIX expressions using stacks (as shown in class). NOTE: There is a SPECIFIC way that these conversion problems are tested. The TA will do problem 1 for you and show you what is expected of you and what you can expect on a test. You should keep a “WORKING” stack that you use to solve the problem. Then you will copy the contents of this working stack, when appropriate, into the given stacks (stacks A, B, and C).
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A B C 1) 44 – 15 / ( 9 - 3 * 2 ) + 12 A B C 2) 12 * ( 8 - 7 + 1 ) - ( 4 + 6 ) / 2 A B C 3) ( 3 + 8 + 5 - 10 ) / 3 + 4 + 5 - 7 A B C 4) 14 - ( 6 - 10 ) - 10 A B C 5) 16 - ( 8 + ( 10 - 7 + 3 ) * 2 - 10 ) / ( ( 4 - 2 ) * 3 - 1 ) Evaluate the POSTFIX expressions that you just developed (after the conversion). Use the stack method that we discussed in class....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online