Purchase Solution

Java program to parse an arithmetic expression

Not what you're looking for?

Ask Custom Question

Write a Java program that takes as input an infix arithmetic expression then transforms it to a postfix expression and based on a binary tree, it evaluates that expression. For instance, the program takes the following infix expression: (1 + 2) * (3 - 4) / (1 + 2) then transforms it to a postfix expression: 1 2 + 3 4 - * 1 2 + / and then stores it in a binary tree. After that, your program should do the opposite: traverse the binary tree and print out the arithmetic expression in infix format.

Purchase this Solution

Solution Summary

The solution shows how to parse an expression in Java.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.