Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))

Answer Posted / rodel

given-> a - b + c * (d / e - (f + g))
note: remember, before we do the infix expression to postfix expression.
We analyze the given data by using the hierarchy of operation (PEMDAS)
In that way, we can do the operation, tracing the hierarchy nos...
sample:
a - b + c * (d / e - (f + g))
5 6 4 2 3 1
pass1: a - b + c * (d / e - (f g +)) infix -> postfix
pass2: a - b + c * (d e / - f g +) infix -> postfix
pass3: a - b + c * (d e / - f g +) infix -> postfix
pass4: a - b + c * (d e / f g + - ) infix -> postfix
pass5: a b - + c d e / f g + - * infix -> postfix

pass6: a b - c + d e / f g + - * infix -> postfix -> Final Answer

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we change load factor of hashmap?

648


Differentiate between queue and stack.

931


Define leaves?

743


What are the best data structure courses for gate preparation?

670


Is sorting a math skill?

654


What do you mean by selection sort?

679


What is data and information explain with example?

716


Define root?

731


What is the difference between Strings and Arrays?

693


What are the Advantages and disadvantages of Array?

779


Define hash function?

689


What is linked hash set?

623


Can we increase the size of statically allocated array?

648


What are the advantages of array?

659


What is heap tree?

656