全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Postfix notation?

Definition 24.5 High School Computer Science · 第 24 章 — Linked Lists, Stacks and Queues

In postfix notation, an operator is written after its two operands: 3+43 + 4 is 3 4 +, and (3+4)×2(3 + 4) \times 2 is 3 4 + 2 *. No brackets and no priority rules are needed: the order of the operators says everything.

The stack while 3 4 + 2 * is read, one picture per token. An operator replaces the two numbers on top by its result (shaded); 14 is left alone at the end.
The stack while 3 4 + 2 * is read, one picture per token. An operator replaces the two numbers on top by its result (shaded); 1414 is left alone at the end.
在原文中阅读 →