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 implementation of an AVL tree and Binary tree.

676


write a program to show the insertion and deletion of an element in an array using the position

649


Is hashmap ordered?

725


What is a binary search tree? Explain with example?

690


How does arraylist store data?

636






How to search binary in a sorted array?

644


Define a path in a tree?

705


What is return map?

715


What is priority queue in data structure?

697


What is the minimum number of nodes in an avl tree of height h?

616


What is the best data structure and algorithm to implement cache?

689


Which is best array or linked list?

644


How does selection sort work?

683


Name few collections map implementations?

653


Can we add duplicate keys in a hashmap?

645