I would like to convert my Binary search tree class but ran into some problems. Below is a snippet of the code which triggers an error when i compile the class.
template <class Type>
BST*BST <Type>:: Insert(BST *root, Type value)
{
if(!root)
{
return new BST(value);
}
if(value > root->data)
{
root->right = Insert(root->right, value);
}
else
{
root->left = Insert(root->left, value);
}
return root;
}
The error message i got is, error: invalid use of template-name 'BST' without an argument list. BST is short for binary search tree. I name my Binary search tree class BST.