On Jun 3, 2:06 pm, Kai-Uwe Bux <jkherci...@gmx.netwrote:

Vinodh wrote:

[...]

2) A binary tree is partioned into three disjoint subsets. That means

all the elements in a binary tree should be unique?

Yes.

Duplicate elements are allowed within a subtree?

No.

I'm not sure I like the wording here. "Duplicate" can (and

usually does, I think) mean a copy, and you can definitely have

elements with identical values (copies of one another) in a

tree. Each element, however, must be "unique", in the sense

that it has a distinct identity from all other elements.

Any significance of this?

Yes: trees do not have cycles.

There's more too it than that, I think. A tree is a directed

graph, but you can have acyclic directed graphs which aren't

trees. The important significance here is that each element

(except the root) has exactly one parent, no more (and the root

has zero). (In fact, the definition that I've usually heard for

a tree is a directed acyclic graph in which exactly one element

has zero elements pointing into it, and all other elements have

one element pointing into them. Although the recursive

definition proposed in the original posting works as well, and

results in the same thing.)

--

James Kanze (GABI Software) email:ja*********@gmail.com

Conseils en informatique orientée objet/

Beratung in objektorientierter Datenverarbeitung

9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34