Multiple choice

Consider the infix expression ((a + b * c))* d + e * (f + g). If the expression tree is drawn, how many nodes are there at the maximum depth?

  1. 2

  2. 3

  3. 4

  4. 5

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The expression tree for ((a + b * c)) * d + e * (f + g) has a maximum depth of 4. At depth 4, there are 2 leaf nodes (e.g., 'a' and 'b' or similar depending on tree construction).