文章
5
粉丝
61
获赞
0
访问
4.6k
三叉树思想
#include<stdio.h>
#include<malloc.h>
#include<queue>
#define MAX 100000
using namespace std;
typedef struct Tnode {
int data;
struct Tnode* L, * M, * R;
struct Tnode* fath;
int flat = 0;
}Tnode,*Ttree;//三叉树
Tnode* Buildtree(Ttree &T,queue<Tnode*> &Q,int &flag,int cow)
{
Tnode* S = (Tnode*)malloc(sizeof(Tnode));
while (flag != 1)
{
S = Q.front();
Q.pop();
if (S->data == cow)return S;
Tnode* A = (Tnode*)malloc(sizeof(Tnode));
Tnode* B = (Tnode*)malloc(sizeof(Tnode));
Tnode* C = (Tnode*)malloc(sizeof(Tnode));
&nbs...
登录后发布评论
暂无评论,来抢沙发