89 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 | 89 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..

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

1
2