86.
How to write a program , Put an ordered array of integers into a binary tree ?
analysis : This paper investigates the construction method of binary search tree , Simple recursive structure . The algorithm design of tree must be associated with
recursion , Because the tree itself is the definition of recursion . and , Learning to change the name of recursion to non recursion is also a necessary technique . after all ,
Recursion can cause stack overflow , On the system of the underlying program must not be used . But for some mathematical problems ,

/* 86. How to write a program , Put an ordered array of integers into a binary tree ? analysis : This paper investigates the construction method of binary search tree , Simple recursive structure . The algorithm design of tree must be associated with
recursion , Because the tree itself is the definition of recursion . and , Learning to change the name of recursion to non recursion is also a necessary technique . after all ,
Recursion can cause stack overflow , On the system of the underlying program must not be used . But for some mathematical problems , We must learn to use the return to solve . Orderly , Direct middle separation Left and right subtrees establish recursion */
#include<iostream> #include<stdio.h> #include<stdlib.h> #include<string.h>
using namespace std; #define N 101 struct Node{ int data; struct Node
*left,*right; }; Node* bulidTree(int array[], int start, int end) { if
(start>end) return NULL; int m=(start+end)/2; Node
*root=(Node*)malloc(sizeof(Node)); root->data=array[m];
root->left=bulidTree(array,start,m-1); root->right=bulidTree(array,m+1,end);
return root; } // Middle order traversal Left root right void displayTreeMid(Node *head) { if(head->left)