in-fix to post-fix conversion

35 views
Skip to first unread message

Muhammad Moiz

unread,
Jun 7, 2015, 10:03:12 AM6/7/15
to dsfas...@googlegroups.com
... * (A + B)...
if i have * on the stack and '(' comes, am i supposed to pop * right away or pop it when '+' comes?

Ghulam Rasool

unread,
Jun 7, 2015, 10:21:04 AM6/7/15
to dsfas...@googlegroups.com
"+" sign will pop only when ")" occurs.

Mehreen Saeed

unread,
Jun 7, 2015, 10:21:34 AM6/7/15
to Muhammad Moiz, dsfas...@googlegroups.com
No, as soon as you see a (, push it on the stack.  So ( will go on top of the * operator.

Mehreen

On Sun, Jun 7, 2015 at 5:50 PM, Muhammad Moiz <l13...@lhr.nu.edu.pk> wrote:
... * (A + B)...
if i have * on the stack and '(' comes, am i supposed to pop * right away or pop it when '+' comes?

--
You received this message because you are subscribed to the Google Groups "DSFAST2015" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dsfast2015+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dsfast2015/CAEPVQgOsRWQLy-pmJudRSS7yAq%3D6gAjO%3Dac%2BnbSxWtNnHs80vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hassan Mirza

unread,
Jun 7, 2015, 10:38:09 AM6/7/15
to dsfas...@googlegroups.com
it is not possible becoz operands are 2 and operators are also two. here operands should be 3. but if u want to salve it, it will be like this. AB+*
Reply all
Reply to author
Forward
0 new messages