Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:是不是判断出来需要多少个节点,左右之树多少个节点,然后递归建立树,最后一次先序编历就好了In Reply To:是不是判断出来需要多少个节点,左右之树多少个节点,然后递归建立树,最后一次先序编历就好了 Posted by:first at 2003-12-10 19:32:09 单纯判断左右子树的结点数是不够的,还要判断左右子树的order(在计算出结点数的基础上做一次除法,一次取模就可以了) 还有,打印的遍历不是先序,而是中序。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator