The definition is recursive. The empty binary tree is the base case
for the recursion. If a binary tree couldn't be empty, then all binary
trees would have to be infinite. One way to think of this is that the
left and right subtrees of the leaf nodes of the tree are empty trees.
Don't confuse
On Tue, Jun 3, 2008 at 1:35 PM, Dave [EMAIL PROTECTED] wrote:
The definition is recursive. The empty binary tree is the base case
for the recursion. If a binary tree couldn't be empty, then all binary
trees would have to be infinite. One way to think of this is that the
left and right
Does that aspect of his question matter as to whether the tree is a
binary tree or a general tree? The point is that the node and the
value associated with the node are entirely different things.
For that matter, my uncle's family tree is not a tree at all, since he
has two paths up the tree to
Yup thats perfectly true. Its just that he is new to the concept so I added
that family trees are usually not binary trees.
In fact they may not even be trees ..they may be graph as Dave suggested !
On Tue, Jun 3, 2008 at 3:58 PM, Dave [EMAIL PROTECTED] wrote:
Does that aspect of his question
On Tue, Jun 3, 2008 at 6:02 PM, Vinodh [EMAIL PROTECTED] wrote:
Wow...Got it.
My refined understanding,
1) An empty tree is haveing zero nodes. Fine.
Case (a)
==
I have only 1 node in a binary tree. That means it is a binary tree
with 2 empty subtrees.
Case (b)
==
I have
In the case of a binary search tree, you don't always make the left
subtree first. See the wikipedia article on binary search trees for
details.
Dave
On Jun 3, 1:02 pm, Vinodh [EMAIL PROTECTED] wrote:
Wow...Got it.
My refined understanding,
1) An empty tree is haveing zero nodes. Fine.
2008/6/4 Vinodh [EMAIL PROTECTED]:
Wow...Got it.
My refined understanding,
1) An empty tree is haveing zero nodes. Fine.
Case (a)
==
I have only 1 node in a binary tree. That means it is a binary tree
with 2 empty subtrees.
Case (b)
==
I have only 2 nodes in a binary tree.