习题6.22 略
习题6.23 略
习题6.24
习题6.31
满二叉树后序序列转换为先序序列
//6.31
void post2pre(Xtype post[],Xtype pre[],int postart ,int poend ,int pestart,int peend )
{
int half ;
if (poend >= postart)
{
pre[pestart] = post[poend] ;
half = (poend - postart) /2 ;
post2pre(post , pre , postart , postart + half - 1 , pestart + 1 , pestart + half ) ;
post2pre(post , pre , postart + half , poend - 1 , pestart + half + 1 , peend ) ;
}
}