Location:
Search - mingtiyansuan
Search list
Description: (1)利用二叉树来计算公式的真值。首先利用堆栈将中缀形式的公式变为后缀形式;然后根据后缀形式,从叶结点开始构造相应的二叉树;最后按后序遍历该树,求各子树之值,即每到达一个结点,其子树之值已经计算出来,当到达根结点时,求得的值就是公式之真值。
(2)逻辑变元的标识符不限于单字母,而可以是任意长的字母数字串。
(3)根据用户的要求显示表达式的真值表。
Platform: |
Size: 6932 |
Author: hillary |
Hits:
Description: (1)利用二叉树来计算公式的真值。首先利用堆栈将中缀形式的公式变为后缀形式;然后根据后缀形式,从叶结点开始构造相应的二叉树;最后按后序遍历该树,求各子树之值,即每到达一个结点,其子树之值已经计算出来,当到达根结点时,求得的值就是公式之真值。
(2)逻辑变元的标识符不限于单字母,而可以是任意长的字母数字串。
(3)根据用户的要求显示表达式的真值表。
-(1) the use of binary tree to calculate the formula for the true value. Stack will be the first to use infix form of the formula into the form of the suffix and then form the basis of the suffix from the beginning of leaf nodes corresponding binary tree structure Finally after by traversal of the tree, and the value of the subtree, that is, for every arrival a node, the value of its sub-tree has been calculated, when the reach the root node, the obtained value is the formula of true value. (2) logical variables are not limited to single-letter identifier, which can be arbitrarily long alphanumeric string. (3) In accordance with the requirements of users showed that expression of the truth table.
Platform: |
Size: 7168 |
Author: hillary |
Hits: