The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+6 votes
2.8k views

Choose the equivalent prefix form of the following expression

(a+(b-c))*((d-e)/(f+g-h))

  1. *+a-bc/-de-+fgh
  2. *+a-bc-/de-+fgh
  3. *+a-bc/-ed-+fgh
  4. *+ab-c/-de-+fgh
asked in DS by Boss (34.1k points) | 2.8k views

6 Answers

+9 votes
Best answer
( a + ( b - c ) ) * ( ( d - e ) / ( f + g - h ) )

( a + ( b - c ) ) * ( ( - de) / ( ( + f g) - h ) )

( a + ( - bc ) ) * ( ( - de ) / ( - + f g h ) )

( + a - b c)  *  ( / - d e - + f g h)

* + a - b c / - d e - + f g h

Option A will be correct...
answered by Boss (23.8k points)
selected by
+5 votes

(A) option answer .

answered by Boss (20.4k points)
+3 votes

To find the equivalent prefix form (or Polish Notation):

1) The given expression is in infix form i.e. fully parenthesized unambigous expression

2) Firstly,we have to make a rooted binary tree for the given expression

3) Then we have to apply Preorder Tree Traversals

4) The obtained expression would be an equivalent prefix or polish notation

On solving we can check that A is the correct answer...

answered by Active (1.2k points)
+2 votes
Answer is A
answered by Junior (903 points)
+1 vote
Option A
answered by (421 points)
+1 vote
Ans: A
answered by Loyal (7.1k points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

36,201 questions
43,662 answers
124,111 comments
42,944 users