Click here to Skip to main content
13,052,433 members (75,001 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I need help to convert an expression Postfix To Infix form in c++ program....
Plz any one help...
Posted 18-Jan-13 22:34pm
Garth J Lancaster 19-Jan-13 4:56am
What code have you written so far ? - What is the specific nature of your issue ?? - this problem has been solved and solutions posted all over the NET - so why dont you find one, try it, and then post back when you have a specific issue ...

If you really cant find a starting point, check out these

PrafullaVedante 21-Jan-13 3:35am
Check out for Euler's Tour traversal technique for binary tree .... It may help
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First implement the process of converting postfix to infix using your notebook.

After figuring out the method implement with C++, that was how I did as well as all other programmer did
SajeeshCheviry 19-Jan-13 7:42am
you are right:-)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Let Me Goggle That For You[^].
However I would suggest yoo to make at least an attempt based just on you theoretical knowledge (did you study the matter, right?).
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

string input = ReadInput();
Stack<string> stack;
foreach(string token in GetTokens(input)) {
   if (IsOperator(token)) {
      string a = stack.Pop();
      string b = stack.Pop();
      stack.Push("(" + b + token + a + ")");
   } else {

No error handling shown above, i.e. garbage-in→garbage-out.
Conversion into C++ is left to you as exercise.

Good Luck!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100