I was asked to convert 7-2+3 into post fix notation while no operator precedence or left to right or right to left was mentioned in the question and then I had to make tree using translation scheme of the post fix notion ed result.
I found it ambiguous because 7-2+3 may give 2 possible results 8 and 2 so I wrote two post fix notations 72-3+ & 723+- and made two possible trees using translation scheme.
I want to confirm either I was Correct or Not.
If you apply Shunting-yard algorithm to 7-2+3
the output is 72-3+
Note: +
and -
are left associative
and have the same precedence
unless otherwise indicated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With