Binary Search Trees
Can anyone help me create a binary search tree with the C language. I am quite new to this language and am finding it difficult to create functions : how to create a binary tree and insert a new node in the tree.
thanks in advance for your help
I'm having a go at this.
I think that what you want to do is think like a tree-pruner (as in a real "Tree"). who wants to keep the tree intact, but get rid of the excess shrub around the outside. Start with thee leaves, then the branches, and well, in a binary tree, once a leaf is cut off the next node up is, guess what, a leaf! Don't cut off anything that is still a branch, wait until it becomes a leaf. So if you have nodes a, b, and c, where b and c are leaves of a, and you have leaf d who branches from node b, then you can either start by deleting c, or d, but not b before d, and of course a should be last. Got it?
Originally Posted by lorannex
"When am I gonna start getting paid for this?"
I understood the concept but my problem is how to implement such concept in actual code (C language) which works hehe....all examples over d net explain in detail but i did not find a piece of code which actually creates and inserts...
thanks for your reply ..i really appreciate