SEARCH operation in a BINARY SEARCH TREE

Discussion in 'C' started by Chantheeya, Mar 7, 2010.

  1. Chantheeya

    Chantheeya New Member

    Joined:
    Mar 7, 2010
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    0
    I need a simple c++ PROGRAM to perform SEARCH operations in a BIANRY SEARCH TREE:thinking::undecided
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
  3. Chantheeya

    Chantheeya New Member

    Joined:
    Mar 7, 2010
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    0
    Thanks a lot for your approach... But if you see the program more deeply, you can see that the program can perform all the operations on a binary search tree except the SEARCHING an element opreation ( and thats exactly what i want )..... :(
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    There is a function in that code to print the elements in order. You can adapt that function so that instead of printing the element it compares it with what you're looking for. This should be quite simple to do.
     
    shabbir likes this.
  5. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice