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 subtrees of the leaf nodes of the tree are empty trees. > > Don't confuse the nodes with any values associated with the nodes. The > nodes are divided into three disjoint subsets, but duplicate values do > not have to be divided correspondingly. Think of a tree describing > family relationships. I have a second cousin whose name is the same as > mine. There would be two nodes distinct nodes in the tree with value > "David S Dodson." These nodes would have different parents and > grandparents, but the same great-grandparents.
Nice example. Nevertheless family tree are suitable examples for general trees rather than binary trees , isnt it ? > > > Dave > > On Jun 3, 5:55 am, Vinodh <[EMAIL PROTECTED]> wrote: > > Started reading about Binary Trees and got the following questions in > > mind. Please help. > > > > Definition of a Binary Tree from "Data Structures using C and C++ by > > Tanenbaum" goes like this, > > "A binary tree is a finite set of elements that is either empty or is > > partitioned into three disjoint subsets. The first subset contains a > > single element called the 'Root' of the tree. The other two subsets > > are themselves binary trees, called the 'Left' and 'Right' subtrees of > > the original tree." > > > > My Questions: > > 1) Why they talk about a binary tree that is totally empty? I mean a > > binary tree with Zero elements? > > > > 2) A binary tree is partioned into three disjoint subsets. That means > > all the elements in a binary tree should be unique? Duplicate elements > > are allowed within a subtree? Any significance of this? > > > > Thanks, > > Vinodh > > > -- Ciao, Ajinkya --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---