文章
37
粉丝
98
获赞
4
访问
21.8k
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
struct node {
int data;
struct node* left, * right;
};
struct node* insertTree(struct node* T,int x) {
if (T == NULL) {//创建结点
T = (struct node*)malloc(sizeof(struct node));
T->data = x;
T->left = NULL;
T->right = NULL;
}
else {
if (x < T->data) {
//往左子树走
T->left = insertTree(T->left, x);
}
else if (x > T->data) {
/...
登录后发布评论
暂无评论,来抢沙发