Question: Consider the following recursive function and tree: void printTree ( Node * node ) { if ( node = = NULL ) return; printTree (

Consider the following recursive function and tree:
void printTree(Node* node){
if (node == NULL) return;
printTree(node->left);
cout << node->key <<"";
printTree(node->right);
}
3(root)
/\
1917
//
86
/\
24
/
9
The following code is called:
printTree(root);
root is a pointer to the node whose key is 3. What is true about the output from cout? Note there may be multiple correct answers, please mark all correct statements. There are no intended errors in the code.
Group of answer choices
4 is printed before 8
8 is printed before 3
9 is printed first
19 is printed before 17

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!