Wednesday, 11 September 2013

‘insert’ was not declared in this scope

'insert' was not declared in this scope

I have two files
bst.h
using namespace std;
#ifndef BINARY_SEARCH_TREE
#define BINARY_SEARCH_TREE
template<class t>
class bstnode{
public: t key;
bstnode *left,*right;
bstnode(){left=right=NULL;}
bstnode(const t& el, bstnode* l=0,bstnode* r=0){
key=l;left=l;right=r;
}
};
template<class t>
class bst{
public: bstnode<t>* root;
bst(){root=NULL;}
~bst(){}
bool isempty()const{return root==NULL;}
bstnode<t>* insert(bstnode<t>*,const t&);
//void delete(const t& el);
//void clear(bstnode<t>*);
t* search(bstnode<t>*,const t&) const;
void preorder(bstnode<t>*);
void inorder(bstnode<t>*);
void postorder(bstnode<t>*);
};

No comments:

Post a Comment