The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
1.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 Veteran (32k points) | 1.8k views

6 Answers

+5 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 Veteran (19.6k points)
selected by
+3 votes

(A) option answer .

answered by Veteran (21.6k points)
+1 vote
Answer is A
answered by (453 points)
+1 vote

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)
0 votes
Option A
answered by (409 points)
0 votes
Ans: A
answered by Boss (6.2k 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

29,157 questions
36,984 answers
92,154 comments
34,823 users