Expression Tree Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Expression Tree Multiple choice Questions and Answers (MCQs)

Question 1
The leaves of an expression tree always contain?
A
operators
B
operands
C
null
D
expression
Biology Questions answers
Question 1 Explanation: 
The leaves of an expression tree always contain the result of a given expression (i.e.) operands.

Question 2
A node can have a minimum of one child.
A
true
B
false
UPSC GS Questions answers
Question 2 Explanation: 
It is possible for a node to have at least one child, as is the case with the unary minus operator.

Question 3
What does the other nodes of an expression tree(except leaves) contain?
A
only operands
B
only operators
C
both operands and operators
D
expression
Geography Questions answers
Question 3 Explanation: 
The nodes other than leaves always contain only operators. There cannot be any operand in those nodes.

Question 4
An expression tree is a kind of?
A
Binary search tree
B
Fibonacci tree
C
Binary tree
D
Treap
Sociology Questions answers
Question 4 Explanation: 
The expression tree is a binary tree and not a binary search tree because it can have more than two children.

Question 5
The expression obtained by recursively producing a left expression, followed by an operator, followed by recursively producing a right expression is called?
A
prefix expression
B
infix expression
C
postfix expression
D
paranthesized expression
History Questions answers
Question 5 Explanation: 
It is an infix expression because the format of an infix expression is given by operand-operator-operand.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<