Popular Posts

Tuesday, April 12, 2011

Boolean paranthesize

Counting Boolean Parenthesizations. You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, there is only 1 way to parenthesize 'true and false xor true' such that it evaluates to true. 

http://codepad.org/wlvIr0Km

1 comment: