Postfix to Infix Conversion Multiple choice Questions and Answers (MCQs)

 

 Buy/Download all MCQ Ebook   >>>Click Here<<<

Postfix to Infix Conversion Multiple choice Questions and Answers (MCQs)

Click on any option to know the CORRECT ANSWERS

Question 1
Which of the following data structure is used to convert postfix expression to infix expression?
A
Stack
B
Queue
C
Linked List
D
Heap
Visual arts Questions answers

Question 1 Explanation: 
To convert the postfix expression into infix expression we need stack. We need stack to maintain the intermediate infix expressions. We use stack to hold operands.

Question 2
The postfix expression abc+de/*- is equivalent to which of the following infix expression
A
abc+-de*/
B
(a+b)-d/e*c
C
a-(a+b)*(d/e)
D
abc+*-(d/e)
KBC Questions answers

Question 2 Explanation: 
Given postfix expression : abc+de/*-

infix ⇒ a(b+c)(d/e)*-

⇒ a(b+c)*(d/e)-

⇒ a-(b+c)*(d/e)

Hence, correct choice is a-(a+b)*(d/e).

Question 3
The equivalent infix expression and value for the postfix form 1 2 + 3 * 4 5 * - will be
A
1 + 2 * 3 - 4 * 5 and -13
B
(2 + 1) * (3 - 4) * 5 and 13
C
1 + 2 * (3 - 4) * 5 and -11
D
(1 + 2) * 3 - (4 * 5) and -11
NTA NET Questions answers

Question 3 Explanation: 
Given postfix expression : 1 2 + 3 * 4 5 * -

⇒ (1 + 2) 3 * 4 5 * -

⇒ ((1 + 2) * 3) 4 5 * -

⇒ ((1 + 2) * 3) (4 * 5) -

⇒ ((1 + 2) * 3) - (4 * 5)

So, the equivalent infix expression is (1 + 2) * 3 - (4 * 5) and it's value is -11.

Question 4
What is the value of the postfix expression 2 3 + 4 5 6 - - *
A
19
B
21
C
23
D
-2
Geography Questions answers

Question 4 Explanation: 
Given postfix expression : 2 3 + 4 5 6 - - *

infix ⇒ (2 + 3)4 (5 - 6) - *

⇒ (2 + 3)*4 - (5 - 6)

Hence, value = (2 + 3) * 4 - (5 - 6) = 5 *4 - (-1) = 20 + 1 =21.

Question 5
The prefix expression of the postfix expression AB+CD-* is
A
(A+B)*(C-D)
B
+AB*-CD
C
A+*BCD-
D
*+AB-CD
Reasoning Questions answers

Question 5 Explanation: 
To convert from postfix to prefi, x we first convert it to infix and then to prefix.

postfix : AB+CD-*

infix ⇒ (A+B) * (C-D)

So, prefix ⇒ +AB*-CD,

⇒ *+AB-CD.

Therefore, correct choice is *+AB-CD.

There are 5 questions to complete.

 

 Buy/Download all MCQ Ebook >>>CLICK HERE<<<