.方法有二一是對該算術表達式(二叉樹)進行後序遍歷得到表達式的後序遍歷序列再按後綴表達式求值二是遞歸求出左子樹表達式的值再遞歸求出右子樹表達式的值最後按根結點運算符(+*/ 等)進行最後求值
.該算術表達式轉化的二叉樹如圖所示
.n(n>)個結點的d度樹共有nd個鏈域除根結點外每個結點均有一個指針所指故該樹的空鏈域有nd(n)=n(d)+個
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/22661.html