diff --git a/Project2.vcxproj b/Project2.vcxproj index 9556046..612c51f 100644 --- a/Project2.vcxproj +++ b/Project2.vcxproj @@ -21,6 +21,7 @@ + @@ -30,6 +31,7 @@ + diff --git a/Project2.vcxproj.filters b/Project2.vcxproj.filters index 652c5cc..be6bba5 100644 --- a/Project2.vcxproj.filters +++ b/Project2.vcxproj.filters @@ -36,6 +36,9 @@ 源文件 + + 源文件 + @@ -56,5 +59,8 @@ 头文件 + + 头文件 + \ No newline at end of file diff --git a/binary_tree.c b/binary_tree.c index 825c22f..94397ba 100644 --- a/binary_tree.c +++ b/binary_tree.c @@ -41,7 +41,8 @@ void traverse_tree(tree_node *roots) printf("error: roots is NULL\n"); return; } - while(roots) + printf("%d\n", roots->value); + while(roots ->left != NULL && roots -> right != NULL) { tree_node *temp[2] = {roots->left,roots->right}; for (int i = 0;i<2;i++) @@ -53,6 +54,7 @@ void traverse_tree(tree_node *roots) printf("%d ",temp[i]->value); } } + printf("\n"); roots = queue[front]; front = (front+1) % 3; }