Write a method int size(Node tree) that returns the number of nodes in the binary tree whose root is tree.
What will be an ideal response?
Assuming a Node class
```
class Node
{
int element;
Node left, right;
Node(int el, Node left, Node right)
{
element = el;
this.left = left;
this.right = right;
}
}
```
```
int size(Node tree)
{
if (tree == null)
return 0;
else
return 1 + size(tree.left) + size(tree.right);
}
```
You might also like to view...
An em dash indicates an explanation or emphasis in a document
Indicate whether the statement is true or false
The Current & Below cloning option samples the artwork ____.
A. by sampling the top two layers B. by sampling the appearance of the artwork as a composite from the current layer and all layers beneath it C. by sampling the top and bottom layers only D. by sampling from the targeted layer only
What Word feature creates form letters by combining constant and variable information?
A) Merge Fields B) Outlining C) Mail Merge D) Boilerplate
What is the starting point for investigating denial of service attacks?
A. Firewall logs B. Tracing the packets C. System logs D. E-mail headers