[理工] 内部路径长

楼主: style78432 (Rain stop)   2020-12-03 22:36:17
total=0
void Count(list,temp)
If(list=null) return 0
list->value=temp
Count(list->Lchild, temp+1)
Count(list->Rchild, temp+1)
total=total+list->value
https://i.imgur.com/OpVDq5V.jpg
想问一下pseudo code 这样写可以吗
单纯算内部路径长的话

Links booklink

Contact Us: admin [ a t ] ucptt.com