More fun with trees

What does the c++ function print(node* Tree) , given below, print for the tree given above? (The tree is a simple Binary Tree)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// Structure of the nodes of the tree
struct node{
    int data;
    node* left;
    node* right;
};

// A function to print the tree data
void print(node* Tree){
    if(Tree){
        print(Tree->right);
        cout<<Tree->data;
        print(Tree->left);
    }
}

×

Problem Loading...

Note Loading...

Set Loading...