文章

82

粉丝

343

获赞

27

访问

661.3k

头像
简单模拟
P1396 华中科技大学
发布于2021年2月1日 19:23
阅读数 7.6k

#include <iostream>
#include <string.h>
using namespace std;

typedef struct node{
    int data;
    struct node *lchild;
    struct node *rchild;
}BiNode,*BiTree;

void insert(BiTree&T,int x){
    BiTree p=T;
    BiTree pre=p;
    while(p){
        if(p->data>x){
            pre=p;
            p=p->lchild;
        }
        else if(p->data<x){
            pre=p;
            p=p->rchild;
        }
        else {
            return ;
        ...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发