How can I convert a boolean query from post-fix to infix notation like these two examples:
Example 1:
infix : Tony and George
post-fix : Tony George and
Example 2:
infix : Tony and George or Lona
post-fix : Tony George and Lona or
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
i am not writing the exact code which you want but i am giving you an idea about it.
you can simply use infix to postfix algorithm which we normally use of mathematical expressions.
you can find one alog here
http://coding.derkeiler.com/Archive/General/comp.programming/2007-12/msg00100.html
and in that algo you can replace operators with your desired Boolean operators(and ,or you can use them like a string also)
some days before i developed a code for infix to postfix in c++ so for reference you can take a look of that
http://peeyushchandel.wordpress.com/2011/02/20/infix-to-postfix-conversioncodealgo/