Câu hỏi phỏng vấn Stacks
Câu hỏi

Explain what are Infix, Prefix and Postfix Expressions?

Câu trả lời

Infix, prefix, and postfix expressions are different ways of representing mathematical or logical expressions. Here's an explanation of each:

Infix Expression

In an infix expression, the operator is written between the two operands. This is the most common and intuitive way for humans to write expressions. For example, the infix expression for addition would be "A + B"[1][4].

Prefix Expression

In a prefix expression, the operator is written before the two operands. It is also known as a "Polish notation". For example, the prefix expression for addition would be "+ A B"[1][2][5].

Postfix Expression

In a postfix expression, the operator is written after the two operands. It is also known as a "Reverse Polish notation". For example, the postfix expression for addition would be "A B +"[1][4][5].

The main differences between these notations are:

  • Infix ...
middle

middle

Gợi ý câu hỏi phỏng vấn

senior

Why do we need Prefix and Postfix notations?

junior

Why Are Stacks Useful?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào