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

Answer Posted / elle

a-b+c*(d/e-(f+g))
=a-b+c*(/de-(+fg))
=a-b+c*(T-S) where T=/de,S=+fg
=a-b+c*-(TS)
=-ab+c*-(TS)
=-ab+c*V where V=-TS
=-ab+*cV
=X+Y where X=-ab,*cV=Y
=+XY
=+-ab*cV
=+-ab*c-TS
=+-ab*c-/de+fg

Is This Answer Correct ?    41 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the Queue

575


Define outdegree of a graph?

548


How do you find the complexity of a bubble sort?

465


What is a data structure? What are the types of data structures?

527


Is hashtable better than dictionary?

516






Advanced problems related to Data Structures were asked

537


What is merge sort and how it works?

481


What does quick sort do?

485


How would you implement two stacks using a single array?

551


What is difference between treeset hashset linkedhashset?

430


How can I study data structures and algorithms?

513


Why is arraylist used?

481


What is the difference between hashset and hashtable?

432


In tree construction which is the suitable efficient data structure?

547


Write an algorithm for inserting and deleting an element from doubly linked list?

499