Removing Binary Tree Node!

Discussion in 'C++' started by JoeAley2003, Jul 17, 2003.

  1. JoeAley2003

    JoeAley2003 Guest

    Hi all...


    I need an example of a

    RemoveNodeFromBTree(Data or Pointer);

    function or even an alghoritm will help.

    Will i need to rearrange the tree after this procedure?



    Thanks.
    JoeAley2003, Jul 17, 2003
    #1
    1. Advertising

  2. JoeAley2003 wrote:
    > Hi all...
    >
    >
    > I need an example of a
    >
    > RemoveNodeFromBTree(Data or Pointer);
    >
    > function or even an alghoritm will help.
    >
    > Will i need to rearrange the tree after this procedure?



    What are the balance requirements for the tree ?
    Gianni Mariani, Jul 17, 2003
    #2
    1. Advertising

  3. JoeAley2003

    Ben Pfaff Guest

    (JoeAley2003) writes:

    > I need an example of a
    >
    > RemoveNodeFromBTree(Data or Pointer);
    >
    > function or even an alghoritm will help.


    Two algorithms, with code, given here:
    http://adtinfo.org/libavl.html/Deleting-from-a-BST.html
    (In C, not C++.)
    --
    "The BOFH persists despite the resistance and criticism from those
    other people, and takes the road less traveled by. The BOFH does
    not follow the crowd merely to gain the crowd's approval. Even if
    the crowd is made of BOFHs." --Greg Andrews
    Ben Pfaff, Jul 17, 2003
    #3
  4. JoeAley2003 wrote:
    >>What are the balance requirements for the tree ?

    >
    >
    >
    >
    > If i understood you right, you may want to know that i used the
    > greater data to the right and the minor to the left.


    Ben Plaff posted the url to a nice article.

    The problem is not left or right it's about how you balance the tree to
    optimize the search time. Look up AVL balanced binary trees.
    Gianni Mariani, Jul 17, 2003
    #4
  5. JoeAley2003

    Ben Pfaff Guest

    Gianni Mariani <> writes:

    > JoeAley2003 wrote:
    > > I need an example of a RemoveNodeFromBTree(Data or Pointer);
    > > function or even an alghoritm will help.
    > > Will i need to rearrange the tree after this procedure?

    >
    > What are the balance requirements for the tree ?


    Since he didn't mention that it's a balanced binary tree, it
    probably isn't.
    Ben Pfaff, Jul 17, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,396
  2. Jimmy
    Replies:
    8
    Views:
    686
    Thomas Matthews
    Dec 4, 2003
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,399
    Dimitre Novatchev
    Aug 24, 2006
  4. Replies:
    0
    Views:
    509
  5. Peter Mueller
    Replies:
    6
    Views:
    4,521
    Stefan Ram
    Jan 13, 2008
Loading...

Share This Page