Oh ok, yeh with another pointer to the parent i can see how it can be done, but for some reason i cant quite get it right. I get a segmentation error when i try to disconnect the successor node. Can...
Type: Posts; User: nfrandsen
Oh ok, yeh with another pointer to the parent i can see how it can be done, but for some reason i cant quite get it right. I get a segmentation error when i try to disconnect the successor node. Can...
i am having a little trouble removing a node with two children from a binary search tree. my algorithms kinda working in that i find a bottom left successor and swap they keys with the node im...
Thanks for the help, the new code seems to work.
bst bst_insert(bst b, char *s){
if( b == NULL ){
bst result = emalloc(sizeof * result);
result->key = emalloc((strlen(s) + 1)...
how else can it be done?
in the main method insert is simply called as b = bst_insert(b, "foo");
if i do it like that inside the insert method the tree could never grow bigger than one node, so...
hey guys,
Im new to C and having a bit of problems inserting into a recursively defined BST. it seems to work ok inserting 3 or 4 items but any more than that and it starts to make duplicates and do...