Expression Tree Multiple choice Questions and Answers (MCQs)
The leaves of an expression tree always contain?
Question 1 Explanation:
The leaves of an expression tree always contain the result of a given expression (i.e.) operands.
A node can have a minimum of one child.
Question 2 Explanation:
It is possible for a node to have at least one child, as is the case with the unary minus operator.
What does the other nodes of an expression tree(except leaves) contain?
both operands and operators
Question 3 Explanation:
The nodes other than leaves always contain only operators. There cannot be any operand in those nodes.
An expression tree is a kind of?
Binary search tree
Question 4 Explanation:
The expression tree is a binary tree and not a binary search tree because it can have more than two children.
The expression obtained by recursively producing a left expression, followed by an operator, followed by recursively producing a right expression is called?
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.