I don't know what it means:
class Tree{
friend ostream& operator<<(ostream&, const Tree&);
private:
TreeNode *Root;
void insert(TreeNode*&,int);
void PrintInOrder(TreeNode*);
int Median(int[],int&);
public:
Tree();
Tree(int);
void insa(int[]);
void ins(int);
void print();
};
ostream& operator<<(ostream& out, const Tree& tree){
out << tree.Root ->GiveValue(tree.Root);
return out;
}
Tree::Tree (){
Root = 0;
}
Tree::Tree(int i){
Root = new TreeNode(i);
}
void Tree::insa(int i[]){
int R,c,temp;
c= Median(i,R);
temp=i[0];
i[0]=c;
i[R]=temp;
for(int ii=0;ii<iSize;ii++){
insert(Root,i[ii]);
}
}
int Median(int i[],int& R){
int j,m=0,M=0,s,C = 0;
s=(sizeof(i)/sizeof(int));
for (int ii = 0; ii<s ;ii++){
for (j =0; j<s;j++){
if(i[ii]<i[j])
m++;
if(i[ii]<i[j])
M++;}
if(m==M){
R=ii;
C=i[ii];
return C;}
}
return 0;
}
insa(i) is called by main, where i[] is declared with 1,2,3,4,5,6,7
iSize is 7, const int.
Why do I get this error:
Error 1 error LNK2028: unresolved token (0A0002B3) "private: int __thiscall Tree::Median(int * const,int &)" (?Median@Tree@@$$FAAEHQAHAAH@Z) referenced in function "public: void __thiscall Tree::insa(int * const)" (?insa@Tree@@$$FQAEXQAH@Z) Alberi binari.obj Alberi binari
Error 2 error LNK2019: unresolved external symbol "private: int __thiscall Tree::Median(int * const,int &)" (?Median@Tree@@$$FAAEHQAHAAH@Z) referenced in function "public: void __thiscall Tree::insa(int * const)" (?insa@Tree@@$$FQAEXQAH@Z) Alberi binari.obj Alberi binari
Thank you if you answer, and please give a look to the NetBeans thread, I really need that too.