关于二叉树rice大学有篇好文章。
看了这篇文章才知道,原来只有左右子树 有空的节点 才允许删除操作。原文是:
Clearly, when both subtrees of a root node are non-empty, then removing the root node is problematic. However, it makes sense to allow root removal when at least one of the subtrees is empty.
关于二叉树还可以参考:
以下是C#的实现。