Consider the following C program segment where CellNode represents a node in a binary tree:
Struct Cell Node {
Struct Cell Node * left child;
Int element;
Struct Cell Node * right Child;
};
Int Get Value(struct Cell Node * ptr) {
Int Value = 0;
if (ptr! = NULL)
if ((ptr - > left child == NULL) &&
(ptr - > right Child == NULL))
Value = 1;
else
Value = value + GetValue(ptr - > left Child) + Get Value(ptr - > right child);
}
return (value);
}
The value returned by GetValue when a pointer to the root of a binary tree is passed as its argument is:
Reveal answer
Fill a bubble to check yourself
