1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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 New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
  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,012
    Likes Received:
    203
    Trophy Points:
    0
    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 New Member

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

Share This Page