SE250:lab-6:kkan048

From Marks Wiki
Jump to navigation Jump to search

I spend near 1 hr to understand the code and start up. i test the code.And i use show_tree to see the outcome.


int sizeOfTree;
Node* rootOfTree;
int sizeOfTree;
int main(){
 sizeOfTree=10;
 rootOfTree = makeRandomTree(sizeOfTree);
 show_tree(0,rootOfTree);
}
0 [0]
         445349752 [5]
       553475508 [4]
         730417256 [5]
     812669700 [3]
   1085377743 [2]
       1191391529 [4]
     1270216262 [3]
       1344887256 [4]
 1481765933 [1]

This function show the key and the level of the node.But it do not show a "real" diagram of the tree

In function show_tree,the searching is "left,right,root".So it is a postorder searching.