Question: Write code (Java) for your own stack class to solve the problems. Do not use the Java built-in Stack class. Problem 1: Infix to Prefix
Write code (Java) for your own stack class to solve the problems. Do not use the Java built-in Stack class.
Problem 1: Infix to Prefix Conversion Write a program that converts an infix (fully parenthesized) expression to a prefix expression. Like you know,the terms "in" and "pre" are according with the operator's position. The program will have to handle only the binary operators +,-, *. . parenthesis, letters and numbers. An example would be an expression like: ((A B)+(2*(CA3))/(2 A)) The program must convert this expression (infix) to the prefix expression:/+*AB*2AC3*2A All expressions of the test cases are expressions with valid syntax. Input Read input from a file "in1.txt". The first line of input is an integer N (N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
