十一
struct node {
datatype data;
node *lchild;
node *rchild;
}typedef node *BTREE; //二元樹結點的結構
int cbt(BTREE t)
{ MAKENULL( QUEUE Q);
bj=
if(t!=NULL)
{ ENQUEUE(t
while(!empty(Q)&&cm)
{ p=DEQUEUE(Q);
if (p
{ bj=
if (p
}
else
{ cm=bj;
ENQUEUE(p
if (p
else ENQUEUE(p
}
}
}
return cm;
}
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23852.html