Original Post
ok, so lets say I have some binary tree function:
template
NODE * binarytree::insertNode(NODE * root,TYPE data)
{
if (root == NULL)
//create node, blah blah
//blah blah blah
//a bunch of code goes here, irrelevent
//here is the problem:
else
if
(data > root->data)
insertNode(root->right,data);
//here is where I want to add my right node
//but I have a problem
}
ok how do I compare the the data? Is this even possible? I can''t overload the > sign for every single data type.
all template binary trees just write addLeftNode() functions and then you have to do it manually in your main. Thats no good, but is that the only way it can be done?