The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
83 views

While evaluating the expression tree, if the left or right child is not present then the value of that particular missing child is taken as 0?

Have a look at this question

In my evaluation, I am getting: ( (a-0) - b ) - 0 + e! = a-b+e!

Answer is given as option c but by this approach, I am getting option (d) as the answer.

asked in DS by (149 points) | 83 views
0
i think the value is satisfied only when a=b and e=0... i am getting only one value..
0

@garvit_vijai OPTION D HOW ???

WE WANT 1 . IN OPTION D e =1  ,, WE DONT WANT THIS NEGATION SYMBOL.  SO E ALWAYS BE 0

+1
1! = 1, So, option 4 also satisfies
0

@garvit_vijai I MISUNDERSTOOD THAT SYMBOL AS NEGATION   :\

YEPP THEN OPTION 4 ALSO SATISFIES..

1 Answer

0 votes
On solving this expression we got a+b+e!

On putting a=-b and e=0 we got 0! Which is equals to 1. So option 1 is correct

On putting a=-b and e=1 we got 1! Which is eauals to 1. So option 2 is correct,

Hence 1 and 2 are correct

So the answer is (c).
answered by (47 points)

Related questions



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

44,249 questions
49,744 answers
164,041 comments
65,842 users