here is the algorithm and a code below in converting infix notation

1) if you encounter "(" push on it on stack

2) if you encounter operators (+,-,*,/) then compare the operators with the top of the stack.As long as the top of the stack has operators with higher or equal priority to the scanned operators you have to keep popping the stack and store it in resultCode:if(x[i]=='('){stack.push(x[i]);}

* * If the token is an operator, o1, then:

* while there is an operator, o2, at the top of the stack, and eitherCode:else if((x[i]=='+')||(x[i]=='-')||(x[i]=='*')||(x[i]=='/'))

o1 is associative or left-associative and its precedence is less than (lower precedence) or equal to that of o2, or

o1 is right-associative and its precedence is less than (lower precedence) that of o2, (i got confised with the algorithm)

pop o2 off the stack, onto the output queue;

* push o1 onto the stack.Code:q=q+stack.pop(); //where q=is a string and stack.pop()=is an o2;

Lastly you have to push the scanned operator on the stackCode:stack.push(x[i]); //where x[i] = o1

3)If you encounter any digits or alphabets then store in in resultCode:stack.push(x[i]); //where x[i] = o1

4)if you encounter ")" keep popping the stack unless you encounter "(" on the stack and store it in resultCode:else if(isdigit(x[i])){q=q+x[i];}

Lastly decrement top by 1 as "(" is of no importance to usCode:else if(x[i]==')'){q=q+stack.pop();}

as i see, that I confused on the scanning of precedence of operators, can you show me clear understanding about the precedence of the operators?Code:top=top-1;