Disagree
a BST can have duplicate entries
the 'equal to' term in the definition allows that
I am surprised to see in the Wiki:

"From the above properties it naturally follows that:

   - Each node (item in the tree) has a distinct key.

"

The example in the question is definitely wrong in the sense that it allows
duplicates in both directions
once the definition is fixed one can have duplicates in 1 direction i.e.
left or right I believe.

On Thu, Jul 1, 2010 at 10:01 PM, mohit ranjan <shoonya.mo...@gmail.com>wrote:

> @Amit
>
> as per wiki, BST definition is
>
>
>    - The left subtree of a node contains only nodes with keys *less than
>    the node's key*.
>    - The right subtree of a node contains only nodes with *keys greater
>    than or equal to the node's key*.
>
> so, this following example is not a BST...
>
>
> Mohit
>
>
>
> On Thu, Jul 1, 2010 at 8:04 PM, amit <amitjaspal...@gmail.com> wrote:
>
>> Can a BST have duplicate  entries ??
>> .........8
>> ......./...\
>> .....7......9
>> ..../..\..../..\
>> ...6...8..8...10
>>
>> i.e is this a BST .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Man goes to doctor. Says he's depressed. Says life seems harsh and cruel.
Says he feels all alone in a threatening world where what lies ahead is
vague and uncertain. Doctor says "Treatment is simple. Great clown
Pagliacci is in town tonight. Go and see him. That should pick you up." Man
bursts into tears. Says "But, doctor...I am Pagliacci."

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to