DSSSB PGT 2021
October 17, 2023Programming
October 17, 2023Programming
Question 42 |
The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X5 + 4X3 + 6X + 5 for a given value of X, using only one temporary variable is ________.
7 | |
8 | |
9 | |
10 |
Question 42 Explanation:
The minimum number of arithmetic operations required to evaluate
P(X) = x5+4x3+6x+5
= x(x4+4x2+6)+5
= x(x(x3+4x)+6)+5
= x(x(x(x2+4))+6)+5
= x(x(x(x(x)+4))+6)+5
4 multiplications & 3 additions.
4 + 3 = 7
P(X) = x5+4x3+6x+5
= x(x4+4x2+6)+5
= x(x(x3+4x)+6)+5
= x(x(x(x2+4))+6)+5
= x(x(x(x(x)+4))+6)+5
4 multiplications & 3 additions.
4 + 3 = 7
Correct Answer: A
Question 42 Explanation:
The minimum number of arithmetic operations required to evaluate
P(X) = x5+4x3+6x+5
= x(x4+4x2+6)+5
= x(x(x3+4x)+6)+5
= x(x(x(x2+4))+6)+5
= x(x(x(x(x)+4))+6)+5
4 multiplications & 3 additions.
4 + 3 = 7
P(X) = x5+4x3+6x+5
= x(x4+4x2+6)+5
= x(x(x3+4x)+6)+5
= x(x(x(x2+4))+6)+5
= x(x(x(x(x)+4))+6)+5
4 multiplications & 3 additions.
4 + 3 = 7
Subscribe
Login
0 Comments