Removing Binary Tree Node!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JoeAley2003

    Removing Binary Tree Node!

    Hi all...


    I need an example of a

    RemoveNodeFromB Tree(Data or Pointer);

    function or even an alghoritm will help.

    Will i need to rearrange the tree after this procedure?



    Thanks.
  • Gianni Mariani

    #2
    Re: Removing Binary Tree Node!

    JoeAley2003 wrote:[color=blue]
    > Hi all...
    >
    >
    > I need an example of a
    >
    > RemoveNodeFromB Tree(Data or Pointer);
    >
    > function or even an alghoritm will help.
    >
    > Will i need to rearrange the tree after this procedure?[/color]


    What are the balance requirements for the tree ?

    Comment

    • JoeAley2003

      #3
      Re: Removing Binary Tree Node!

      >[color=blue]
      > What are the balance requirements for the tree ?[/color]



      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.


      Thank you for your reply!

      Comment

      • Ben Pfaff

        #4
        Re: Removing Binary Tree Node!

        joealey2003@yah oo.com (JoeAley2003) writes:
        [color=blue]
        > I need an example of a
        >
        > RemoveNodeFromB Tree(Data or Pointer);
        >
        > function or even an alghoritm will help.[/color]

        Two algorithms, with code, given here:

        (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

        Comment

        • Gianni Mariani

          #5
          Re: Removing Binary Tree Node!

          JoeAley2003 wrote:[color=blue][color=green]
          >>What are the balance requirements for the tree ?[/color]
          >
          >
          >
          >
          > 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.[/color]

          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.

          Comment

          • Ben Pfaff

            #6
            Re: Removing Binary Tree Node!

            Gianni Mariani <gi2nospam@mari ani.ws> writes:
            [color=blue]
            > JoeAley2003 wrote:[color=green]
            > > I need an example of a RemoveNodeFromB Tree(Data or Pointer);
            > > function or even an alghoritm will help.
            > > Will i need to rearrange the tree after this procedure?[/color]
            >
            > What are the balance requirements for the tree ?[/color]

            Since he didn't mention that it's a balanced binary tree, it
            probably isn't.

            Comment

            Working...