您的位置:首页 > 其它

[CareerCup] 9.11 Parenthesize the Expression 表达式加括号

2015-10-01 14:11 218 查看
9.11 Given a boolean expression consisting of the symbols 0,1, &, |, and ^, and a desired boolean result value result, implement a function to count the number of ways of parenthesizing the expression such that it evaluates to result.
EXAMPLE
Expression: 1^0|0|1
Desired result: false (0)
Output: 2 ways. 1^((0|0)|1) and 1^(0|(0|1)).
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: