问题

计算数学 >> 数据结构
Questions in category: 数据结构 (Data Structure).

证明任何一个 N 个结点的二叉树, 都有 N+1 个 NULL 链.

Posted by haifeng on 2013-03-28 11:13:50 last update 2013-03-28 11:13:50 | Answers (1) | 收藏


Hint: 用归纳法证明.


回忆:

一个二叉树的任意一个结点最多有两个 childs, 所以可以使用 双向链表 的结构直接链接 childs.

struct BinaryNode
{
	Object	element;	// The data in the node
	BinaryNode	*left;	// Left child
	BinaryNode	*right;	//right child
}