View Full Version : any programmers?
Yo. Just wondering if there are any programmers on this site. Cause, ummm, i need help with an assignment. Gotta make a delete procedure for an implementation of a B-tree. If anyone knows what that is, mind helping an old chum out.
Cabot_Teg118
07-29-2003, 08:30 AM
I've been taking programming courses at school, but I have no idea what you're talking about. What language is it?
Sorry I can't help
caniswolfie
07-29-2003, 09:35 AM
Well to delete from a Binary Tree you start at the Root and do a search to find the element you need to delete. If the element is at the bottom level you can just delete it.
If the element has leaves you need to decide which leaf you want to put it the place of the one you deleted and reorganize the leaves below it. Usually by shifting down.
[Ediit]
Here's a link with the procedure for deleting in binary trees.. better than I could explain it.. :)
http://www.onthenet.com.au/~grahamis/int2008/week08/lect08.html#deletion
Well to delete from a Binary Tree you start at the Root and do a search to find the element you need to delete. If the element is at the bottom level you can just delete it.
If the element has leaves you need to decide which leaf you want to put it the place of the one you deleted and reorganize the leaves below it. Usually by shifting down.
[Ediit]
Here's a link with the procedure for deleting in binary trees.. better than I could explain it.. :)
http://www.onthenet.com.au/~grahamis/int2008/week08/lect08.html#deletion
ROFL Canis. Binary trees are simple. A b-tree is a bit different. I am using C to make the implementation of a B-tree. A B-tree is a Binary-tree with every node itself an array of keys(keys that are pointing to the data of course). And the requirements of a B-tree is that all the nodes must be balanced.
caniswolfie
07-29-2003, 02:06 PM
In that case.. these two links may be helpful..
http://www.semaphorecorp.com/btp/algo.html
http://www.fawcette.com/javapro/2002_01/magazine/features/rgrehan/default_pf.asp
The first is a little to the point.
The second is a bit wordy and goes over what a B-tree is, but does mention ways to do a deletion, no code though.
In that case.. these two links may be helpful..
http://www.semaphorecorp.com/btp/algo.html
http://www.fawcette.com/javapro/2002_01/magazine/features/rgrehan/default_pf.asp
The first is a little to the point.
The second is a bit wordy and goes over what a B-tree is, but does mention ways to do a deletion, no code though.
wow, thanks for the links. THe second link is actually pretty helpful. thanks a lot.
vBulletin v3.5.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.