Home > Back-end >  For help, is there any bosses will be the problem
For help, is there any bosses will be the problem

Time:01-16

By user input elements based on preorder traversal and ways to create a contains seven node binary tree on the list, based on the traversal and exchange, to ensure that any left child node of the element value is not less than brothers node, require using a function pointer in the traversal functions, adopt the method of first order output output binary tree node,
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:
  • Related