Skip to content

A C++ program which accepts infix arithmetic expressions involving single-digit operands and the operators + (addition), - (subtraction), * (multiplication), and / (division) and outputs equivalent prefix expressions.

License

Notifications You must be signed in to change notification settings

TerminalBear/binaryExpressionTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

binaryExpressionTree

A C++ program which accepts infix arithmetic expressions involving single-digit operands and the operators + (addition), - (subtraction), * (multiplication), and / (division) and outputs equivalent prefix expressions. All input expressions are valid, fully paranthesized expressions with a single space before and after all operators. The input file will be infix.dat. For this example, infix.dat has the following operations within it to be converted to the prefix:
(3 + 4)
((5 + 4) * 8)
((0 * (1 + 2)) / (3 - (4 + 5)) * (6 / 7 / (8 * 9)))
(1 - 3 * (4 + 5 * 6) + 7)
Sample output of first two lines:
+34
*+548

About

A C++ program which accepts infix arithmetic expressions involving single-digit operands and the operators + (addition), - (subtraction), * (multiplication), and / (division) and outputs equivalent prefix expressions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages