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);
    }
}


The answer is 9452116572.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...