Code:
template<class Type>
class Tree
{
private:
struct Node
{
Type item;
// node[0] = parent;
// node[1] = left child;
// node[2] = right child;
Node * node[3];
};
Node * root;
public:
Tree():root(NULL) {}
Node* search_tree(Type x);
};
template<class Type>
Tree<Type>::Node * Tree<Type>::search_tree(Type x)
{
if( this == NULL) return NULL;
if(this->item == x)
return this;
else if( this->item < x )
return this->node[1].search_tree(x);
else
return this->node[2].search_tree(x);
}
That class template keeps giving me the errors;
Code:
error: expected constructor, destructor, or type conversion before ‘*’ token
does anyone know how to fix that error?