请斑竹帮忙调试一下这个程序,修改的差不多没错误了,但运行输入数据后会弹出调试窗口说什么Loaded 'C:\WINNT\system32\NTDLL.DLL', no matching symbolic information found.,Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.究竟是什么回事?怎么总是说我的dll文件有问题?
#include <iostream.h>
#include<stdlib.h>
class bintreenode
{
friend class binarytree;
public:
bintreenode():leftchild(NULL),rightchild(NULL){}
bintreenode(int item,bintreenode *left=NULL,bintreenode *right=NULL):data(item),leftchild(left),rightchild(right){}
private:
bintreenode *leftchild, *rightchild;
int data;
};
class binarytree
{
public:
binarytree():root(NULL){}
binarytree(int value):refvalue(value),root(NULL){}
int insert(int &item);
int find(int &item);
private:
bintreenode *root;
int refvalue;
};
class bst;
class bstnode:public bintreenode
{
friend class bst;
public:
bstnode():leftchild(NULL),rightchild(NULL){}
bstnode(int d):data(d),leftchild(NULL),rightchild(NULL){}
protected:
int data;
bstnode *leftchild,*rightchild;
};
class bst:public binarytree
{
public:
bst():root(NULL){}
bst(int value);
int find(int &x){return find(x,root)!=NULL;}
void remove(int &x){remove(x,root);}
bstnode *find(int &x,bstnode *ptr);
bstnode *lastfound;
bstnode *root;
private:
int refvalue;
void insert(int &x,bstnode *&ptr);
void remove(const int &x,bstnode *&ptr);
bstnode * min(bstnode *ptr){return min(root);}
};
bstnode *bst::find(int &x,bstnode *ptr)
{
if(ptr==NULL)return NULL;
else if(x<ptr->data)return find(x,ptr->leftchild);
else if(x>ptr->data)return find(x,ptr->rightchild);
else return ptr;
}
void bst::insert(int &x,bstnode *&ptr)
{
if(ptr==NULL)
{
ptr=new bstnode(x);
if(ptr==NULL){cerr<<"out of space"<<endl;exit(1);}
}
else if(x<ptr->data)insert(x,ptr->leftchild);
else if(x>ptr->data)insert(x,ptr->rightchild);
}
bst::bst(int value)
{
int x; bstnode *root=NULL; int refvalue=value;
cin>>x;
while(x!=refvalue)
{
insert(x,root);cin>>x;
}
}
void bst::remove(const int &x,bstnode *&ptr)
{
bstnode *temp;
if(ptr!=NULL)
if(x<ptr->data)remove(x,ptr->leftchild);
else if(x>ptr->data)remove(x,ptr->rightchild);
else if(ptr->leftchild!=NULL&&ptr->rightchild!=NULL)
{
temp=min(ptr->rightchild);
ptr->data=temp->data;
remove(ptr->data,ptr->rightchild);
}
else
{
temp=ptr;
if(ptr->leftchild==NULL)ptr=ptr->rightchild;
else if(ptr->rightchild==NULL)ptr=ptr->leftchild;
delete temp;
}
}
void main()
{
bst a(0);
for(int i=1;i<100;i++)
{
a.lastfound=a.root;
int count=0;
while(1)
{
if(a.find(i,a.lastfound)==NULL)
break;
else if(a.find(i,a.lastfound)!=NULL)
{
count++;
bstnode *temp=a.find(i,a.lastfound);
a.remove(i,a.find(i,a.lastfound));
a.lastfound=temp;
}
}
cout<<i<<"的个数为"<<count<<endl;
}
}