A Computer Science Professor at Stanford University used the following function to compute the number of nodes in a Binary Tree.

Code:`/*`

Compute the number of nodes in a tree.

*/

int size(struct node* node) {

if (node==NULL) {

return(0);

} else {

return(size(node->left) + 1 + size(node->right));

}

}

Why use this method instead of doing something like a pre-order traversal?