https://i.imgur.com/DWfMUej.jpg
想问一段叙述
给了一张图片,并详细叙述了以下,
我的问题在于,明明B只有一个child,为什么他要说B有两个children. 难道"Empty"也算
一个node吗?
Figure 7.2.1:
*****
Node B has two children: Its left child is the empty tree and its right child
is D. (我的问题在这里)
*****
我的疑点是从这个网站的练习题其中一题才有的,另外附上此网站的练习题
Which statement is false? (答案是A,我的疑点在D)
(A) Every binary tree has at least one node
(B) Every non-empty binary tree has exactly one root node
(C) Every non-root node in a binary tree has exactly one parent
(D) Every node in a binary tree has exactly two children
(E) None of the above
他的解释如下:
Look carefully at the definition for a binary tree.
It states that every binary tree is either empty, or it has a root node and tw
o binary trees as children.
So, every binary tree node has two children, but not every binary tree has a n
ode.(看不太懂这句给的结论)
来源:https://opendsa-server.cs.vt.edu/ODSA/Books/CS3/html/BinaryTree.html#def
initions-and-properties