ONP  Transform the Expression
Transform the algebraic expression with brackets into RPN form (Reverse Polish Notation). Twoargument operators: +, , *, /, ^ (priority from the lowest to the highest), brackets ( ). Operands: only letters: a,b,...,z. Assume that there is only one RPN form (no expressions like a*b*c).
Input
t [the number of expressions <= 100] expression [length <= 400] [other expressions]
Text grouped in [ ] does not appear in the input file.
Output
The expressions in RPN form, one per line.
Example
Input: 3 (a+(b*c)) ((a+b)*(z+x)) ((a+t)*((b+(a+c))^(c+d))) Output: abc*+ ab+zx+* at+bac++cd+^*
hide comments
surya_55:
20181204 10:43:11
solved by using just stack in one go...! 

Ritwik:
20181204 08:18:08
There is a problem in test cases. My solution is AC in first attempt but later I found out it gives wrong output in those testcases which are without brackets. For example: "a*b+c" 

nishantingle5:
20181114 18:29:20
The Great Dijkstra's Shunting Yard Algorithm 

pranjulpal18:
20181108 12:12:12
. 

boosandi:
20181102 12:52:36
I checked out the Shunting yard problem and implemented it. It was such a beautiful algo. 

ianc1339:
20181028 08:57:50
Tbh, I had to search up what RPN was... 

s307177205:
20181027 11:01:38
well, the test cases don't contain data like ab*c, whose priority needs to be considered. 

artistic_15:
20180920 20:00:21
easy just use of one stack and one queue. Last edit: 20180921 08:30:31 

marcobw1:
20180911 12:30:22
Last edit: 20180911 12:30:43 

probeta:
20180828 18:59:59
Just implement properly ! 
Added by:  mima 
Date:  20040501 
Time limit:  5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 VB.NET 
Resource:   