The sample input
2 4. 1. 5 7... 3 6...
Sample output
1 3 4 5 7 2 6
CodePudding user response:
This topic describes easily misleading that is according to preorder traversal individually to insert and sort the input data,Actually the input data, it is a 7 nodes of a binary tree by preorder traversal of the output as a result,
As long as you press the topic request, left and right child nodes in the graph is used to numerically cross substitution, guarantee value is greater than the left and right
In order to your function task, namely, the input values to fill into the node, and then iterate through all the left and right child nodes, change the figure above to the following: