Number of binary tree shapes of N nodes are there with height N-1?

笑着哭i 提交于 2019-12-13 22:02:32

问题


How many binary tree shapes of N nodes are there with height N-1? Also, how would you go about proofing by induction?

So binary tree of height n-1 with node n means all node will have only 1 child, sort of chain like structure? So number of binary tree will be different permutation of n numbers which is n. Am I thinking in the right direction?


回答1:


You are thinking in the right direction and you have correctly transformed the original problem to a simple one. However what is strange is that it is explicitly stated that the tree is "binary" when in fact the statement dictates even tighter constraint.



来源:https://stackoverflow.com/questions/32397904/number-of-binary-tree-shapes-of-n-nodes-are-there-with-height-n-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!