习题6.22 习题6.23 习题6.24 习题6.31

来源:互联网 发布:c语言病毒代码大全 编辑:程序博客网 时间:2024/05/21 09:00

习题6.22 略

习题6.23 略

习题6.24

习题6.31

满二叉树后序序列转换为先序序列

//6.31void 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           ) ;}}


 

原创粉丝点击