Consider a Boolean function of ‘n’ variables. The order of an algorithm that determines whether the Boolean function produces a output 1 is
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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.