Consider a Boolean function of ‘n’ variables. The order of an algorithm that determines whether the Boolean function produces a output 1 is
(A) Logarithmic
(B) Linear
(C) Quadratic
(D) Exponential
Answer: (D)
Explanation: For ‘n’ boolean variable, we have 2^n rows in the truth table written for it, each row having 0 or 1 for the function. for the algorithm that determines whether the Boolean function produces a output 1, in worst case we will have to check each row of table if only last row have function value 1.
So we will have to search 2^n rows, so the order is Exponential.
Quiz of this Question