配置二叉树时,是否可以只将高度增加到空节点?

When configuring a binary tree, is it possible to just increase the height to a null node?

比如这样的二叉树是否存在?

     A        
   /   \      
  N     N     
 / \   / \  
N   B C   N 

这只是出于好奇而提出的问题。

是的,这棵树可以存在。二叉树的主要规则是它最多可以有两个 children.

不过,还有Binary search tree。 BST是二叉树,但是条件比较多:

  • 所有键(节点内的数据)都是unique/distinct。
  • 每个parent节点的左child键值,小于parent节点键值。
  • 每个parent节点的每个右child键值,都大于parent节点键值。