1.

Consider the expression T & F | T. What is the number of ways in which the expression can be parenthesized so that the output is T (true)?(a) 0(b) 1(c) 2(d) 3The question was posed to me in a national level competition.The question is from Counting Boolean Parenthesizations in chapter Dynamic Programming of Data Structures & Algorithms II

Answer»

The correct choice is (c) 2

To EXPLAIN: The expression can be PARENTHESIZED as T & (F | T) and (T & F) | T so that the output is T.



Discussion

No Comment Found

Related InterviewSolutions