domingo, julio 20, 2008

Binary Search Tree in Ansi C

Ok guys, after getting the foolish error in my code, now I release the (almost, half some functions to add) whole code of the Binary Search Tree in ANSI C.

see ya!!

The URL:

PS: If you found any error in my code, or if you found that my english sucks, please tell me!!


-Update 1: Added the PreOrder and PostOrder traversal methods/functions.
-Uptade 2: Added the Search method/function.

martes, julio 15, 2008

Binary Search Tree --- damn it!!


The problem was at line 68 @ bst.c, self_node was a pointer to a pointer structure, so to make a bifurcation it's necessary to use the * operator, but I had self_node without the * operator. But now the problem is fixed, and I can continue programming more functionts to the tree.


Hi people,

In the "Data Structure" class, I had to build a Binary Search Tree with some functions related, so I tried to make the program in ANSI C with some OOP emulation (something of "Object-Oriented with ANSI C" by Axel-Tobias Schreiner), but I got a little trouble, the _insertItem() function doesn't work (line 67~74 @ bst.c file). Really, I have no idea what is going on in those lines, they are supposed to work, but they aren't.

So people I need your help, because I don't know how fix it. :(

here is the URL:


PS: If you found that my english sucks tell me! I need to improve it. :D

Change Log:

Update 1: I changed the bst.c file, but it still have problem, now it has a segfault. lol :P
Update 2: Fixed!, thanks to XBREAK and specially to tezeract.