# YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

## Expression Tree Multiple choice Questions and Answers (MCQs)

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

The leaves of an expression tree always contain?

operators | |

operands | |

null | |

expression |

Question 1 Explanation:

The leaves of an expression tree always contain the result of a given expression (i.e.) operands.

Question 2 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

A node can have a minimum of one child.

true | |

false |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What does the other nodes of an expression tree(except leaves) contain?

only operands | |

only operators | |

both operands and operators | |

expression |

Question 3 Explanation:

The nodes other than leaves always contain only operators. There cannot be any operand in those nodes.

Question 4 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

An expression tree is a kind of?

Binary search tree | |

Fibonacci tree | |

Binary tree | |

Treap |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

The expression obtained by recursively producing a left expression, followed by an operator, followed by recursively producing a right expression is called?

prefix expression | |

infix expression | |

postfix expression | |

paranthesized expression |

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.