473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Removing Binary Tree Node!

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.
Jul 19 '05 #1
5 4460
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 ?

Jul 19 '05 #2
>
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.
Thank you for your reply!
Jul 19 '05 #3
jo*********@yahoo.com (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
Jul 19 '05 #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.

Jul 19 '05 #5
Gianni Mariani <gi*******@mariani.ws> 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.
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jimmy | last post by:
Hi everyone, I am working with a binary tree, and I am having a bit of trouble visuallizing what needs to happen when I am trying to delete a node that has two children. (no child node and one...
7
by: pembed2003 | last post by:
Hi, I have a question about how to walk a binary tree. Suppose that I have this binary tree: 8 / \ 5 16 / \ / \ 3 7 9 22 / \ / \ / \
11
by: jova | last post by:
Is there a difference between a Binary Tree and a Binary Search Tree? If so can someone please explain. Thank You.
0
by: j | last post by:
Hi, Anyone out there with binary search tree experience. Working on a project due tomorrow and really stuck. We need a function that splits a binary tree into a bigger one and smaller one(for a...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
15
by: Foodbank | last post by:
Hi all, I'm trying to do a binary search and collect some stats from a text file in order to compare the processing times of this program (binary searching) versus an old program using linked...
1
TMS
by: TMS | last post by:
I'm trying to write an address book that is based on a binary tree. I'm devloping in Visual C++ (I blew up my Ubuntu with the new dist, so no EMACS), starting with the basics: #ifndef...
4
by: whitehatmiracle | last post by:
Hello I have written a program for a binary tree. On compiling one has to first chose option 1 and then delete or search. Im having some trouble with the balancing function. It seems to be going...
2
by: Defected | last post by:
Hi, How i can implement a main function with this Binary Search Tree. thanks for help. is this code corrected ? #include<iostream>
7
by: Vinodh | last post by:
Started reading about Binary Trees and got the following questions in mind. Please help. Definition of a Binary Tree from "Data Structures using C and C++ by Tanenbaum" goes like this, "A...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.