|
阅读:2096回复:0
怎么算树的深度?
func getdep(t:bittree):integer;
{t指向根接点} if t=nil return(0); else return(max(getdep(t.lchind),getdep(t.rchild))+1) endf;{getdep} 请问如何以此例理解递归深度和递归数的含义。请指教 -------------------- Optimistic is my color We spend our time on something from dawn to dark Day in and day out Sun rise and down Make an own goal to confront life Self-discovery is the first step toward self-appreciation 成功只会降临在自认为会成功的人身上 |
|