問題タブ [polish-notation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
428 参照

math - The prefix form of A-B/ (C * D ^ E)?

Could anyone please explain this answer?

Screenshot - Click Here

0 投票する
1 に答える
82 参照

python - 逆ポーランド記法アルゴリズムが同じオペランドで正しく機能しない

私はポーランド記法アルゴリズムを書きました。ただし、演​​算子間に同じオペランドがあると正しく動作しません。このコードを現在のリスト ['a', '+', 'a', '*', 'b'] で実行すると正しく動作しますが、(a) を (b) に変更すると動作しません。 . 最初のケースの結果は (a, a, b, *, +) で、2 番目のケースの結果は (a, a, +, a, *) です。なぜそれが起こるのですか?