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.

Results 1 to 5 of 5

Thread: Binary Search Tress QUESTION

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Binary Search Tress QUESTION

    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?


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Binary Search Tress QUESTION

    What happened when you tried?

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Binary Search Tress QUESTION

    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

  4. #4
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Binary Search Tress QUESTION

    You have your suspicions and theory ..
    time to hit the editor of choice and put some code to it

  5. The Following User Says Thank You to jps For This Useful Post:

    oscarmiles99 (November 13th, 2013)

  6. #5
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Binary Search Tress QUESTION

    Doing that right now

  7. The Following User Says Thank You to oscarmiles99 For This Useful Post:

    jps (November 13th, 2013)

Similar Threads

  1. Binary Search Help
    By OwsumEmam in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 31st, 2011, 11:01 PM
  2. Binary Search Help!
    By Allicat in forum What's Wrong With My Code?
    Replies: 8
    Last Post: March 15th, 2011, 04:03 PM
  3. Binary Search Loop
    By Tarakara in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 29th, 2010, 09:22 AM
  4. Polymorphic Binary Search Tree Question
    By MJS139115 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 9th, 2010, 06:08 PM
  5. Binary Search Tree
    By Koren3 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 12th, 2009, 09:27 AM