An expression tree is a kind of?

Category: QuestionsAn expression tree is a kind of?
Editor">Editor Staff asked 1 month ago

An expression tree is a kind of?
 
(a) Binary search tree
 
(b) Fibonacci tree
 
(c) Binary tree
 
(d) Treap
 
I’d like to ask this question from Trees in division Trees of Data Structures & Algorithms I
 
This question was posed to me in a job interview.

1 Answers
Editor">Editor Staff answered 1 month ago

The correct choice is (c) Binary tree
 
The best explanation: The expression tree is a binary tree. It contains operands at leaf nodes and remaining nodes are filled with operators. The operands and the operators can be arranged in any order (ascending, descending).