wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Infix to Postfix Conversion Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is infix notation?

a)

Operators are placed before the operands.

b)

Operators are placed after the operands.

c)

Operators are placed randomly.

d)

Operators are placed between the operands.

2.

What is postfix notation also known as?

a)

Polish notation

b)

Reverse Polish notation

c)

Standard notation

d)

Infix notation

3.

Which data structure is primarily used for converting infix to postfix?

a)

Array

b)

Queue

c)

Linked List

d)

Stack

4.

In the expression 'a + b * c', what is the postfix equivalent?

a)

ab+c*

b)

abc*+d-

c)

a+b*c

d)

abc*+

5.

What happens when a closing parenthesis is encountered during conversion?

a)

Pop operators until an opening parenthesis is found.

b)

Add the closing parenthesis to the postfix expression.

c)

Push the closing parenthesis onto the stack.

d)

Ignore the closing parenthesis.

6.

What is the precedence of the operator '^'?

a)

1

b)

4

c)

2

d)

3

7.

In the algorithm for infix to postfix conversion, what is done with operands?

a)

They are pushed onto the stack.

b)

They are added to the postfix expression.

c)

They are converted to infix.

d)

They are ignored.

8.

What is the output of the infix expression 'a*b^c-(d^e*f^g)+h' in postfix?

a)

abc^*de^fg*-h+

b)

abc^*de^fg^*h+

c)

abc^*de^fg^-h+

d)

abc^*de^fg^*-h+

9.

What is the first step in converting an infix expression to postfix?

a)

Create an empty stack.

b)

Create an empty postfix string.

c)

Read the infix expression from right to left.

d)

Identify the highest precedence operator.

10.

What does the algorithm do when it encounters an operator with lower precedence than the one on top of the stack?

a)

Pop the operator from the stack and add it to the postfix expression.

b)

Push the current operator onto the stack.

c)

Ignore the operator.

d)

Replace the operator on the stack.