Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
の結果の値はどうなりますか7 4 3 + - 3 9 2 / + * 2 ^ 5 *
7 4 3 + - 3 9 2 / + * 2 ^ 5 *
ポスト順です。では、この式の値を取得するにはどうすればよいでしょうか。
右側から評価します。中間ノードよりも演算子の場合。それ以外の場合はリーフです。
したがって、" " はすべてのルートです。「5」は右側の葉です。「^」を他の中間ノードとして開始するよりも。「2」は右葉です。" " は左中間ノードです。等々。
したがって、最終的な式は
(((7(43+)-)(3(92/)+)*)2^)5* => (((7-(4+3)) * (3+(9/2)))^2) * 5 = 0