Data Structure Questions and Answers-Evaluation of an Infix Expression (Not Parenthesized)

 

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

Data Structure Questions and Answers-Evaluation of an Infix Expression (Not Parenthesized)

Click on any option to know the CORRECT ANSWERS

Question 1
How many stacks are required for applying evaluation of infix expression algorithm?
A
one
B
two
C
three
D
four
English grammar Questions answers

Question 1 Explanation: 
Two stacks are required for evaluation of infix expression - one for operands and one for operators.

Question 2
How many passes does the evaluation of infix expression algorithm makes through the input?
A
One
B
Two
C
Three
D
Four
Public administration Questions answers

Question 2 Explanation: 
Evaluation of infix expression algorithm is linear and makes only one pass through the input.

Question 3
Identify the infix expression from the list of options given below.
A
a/b+(c-d)
B
abc*+d+ab+cd+*ce-f-
C
ab-c-
D
+ab
Aptitude test Questions answers

Question 3 Explanation: 
a/b+(c-d) is an infix expression since the operators are placed in between the operands.

Question 4
Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?
A
Operand is pushed on to the stack
B
If the precedence of operator is higher, pop two operands and evaluate
C
If the precedence of operator is lower, pop two operands and evaluate
D
The result is pushed on to the operand stack
Visual arts Questions answers

Question 4 Explanation: 
If the precedence of the operator is higher than the stack operator, then it is pushed on to the stack operator.

Question 5
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 1+2*3-2
A
3
B
6
C
5
D
4
Management Questions answers

Question 5 Explanation: 
According to precedence of operators, * is evaluated first. + and - have equal priorities. Hence, 1+6-2= 5.

There are 5 questions to complete.

 

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