mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Useless Brackets: Vikas Sir

4 posters

Go down

Useless Brackets: Vikas Sir Empty Useless Brackets: Vikas Sir

Post  ballu Sun Feb 01, 2009 10:52 pm

Given a an expression find whether there are useless brackets or not
example
(A(+)B) useless bracket around + sign
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

Useless Brackets: Vikas Sir Empty Re: Useless Brackets: Vikas Sir

Post  udita Mon Feb 02, 2009 9:06 am

push the operators and operands until u get a closing bracket . on getting it pop the topmost element store it in a temp var pop once more(this time the opening bracket).push the saved one .
plzz tell me whether dis will work or not

udita

Posts : 11
Join date : 2009-02-01

Back to top Go down

Useless Brackets: Vikas Sir Empty Re: Useless Brackets: Vikas Sir

Post  Admin Mon Feb 02, 2009 9:50 am

How about converting to prefix.removing all brackets,
converting back??

Admin
Admin

Posts : 47
Join date : 2009-01-29

https://mockers.forumotion.com

Back to top Go down

Useless Brackets: Vikas Sir Empty Re: Useless Brackets: Vikas Sir

Post  mnnit.rahul Mon Feb 02, 2009 3:14 pm

i also think above answer will work is there any other better solution??

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

Useless Brackets: Vikas Sir Empty Re: Useless Brackets: Vikas Sir

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum