計算表達式樹

很簡單,採用遞歸的方式來計算表達式樹(二叉樹)。java 什麼是表達式樹,請看例子:node 下面給出從根節點開始,計算表達式樹的值得算法:算法 //計算表達式樹 public static double caculatePloenTree(treeNode root) { if(!(root.type.equals("+") || root.type.equals("-")|
相關文章
相關標籤/搜索