In a Binary Search Tree when a duplicate is added is the new one or the old one in the resulting tree?
Can someone explain this to me?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
In a Binary Search Tree when a duplicate is added is the new one or the old one in the resulting tree?
Can someone explain this to me?
What happened when you tried?
I'm guessing both (old and new) are in the same resulting tree. I'm not sure
Say:
13 nodes are in this order:
A B C D E F G H I J K L M
F G H are added in front of the existing data 16 nodes
F G H A B C D E F G H I J K L M
In this case, whatever node appears in front will be added to the tree. Duplicates will be ignored???
So in the resulting tree there will only be 13 nodes in it
You have your suspicions and theory ..
time to hit the editor of choice and put some code to it
oscarmiles99 (November 13th, 2013)
Doing that right now
jps (November 13th, 2013)