| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 514 人关注过本帖
标题:请高手帮忙调试一下
只看楼主 加入收藏
chencyh
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2005-11-12
收藏
 问题点数:0 回复次数:5 
请高手帮忙调试一下

请斑竹帮忙调试一下这个程序,修改的差不多没错误了,但运行输入数据后会弹出调试窗口说什么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;
}
}

搜索更多相关主题的帖子: 调试 
2005-11-26 16:48
babybluecat
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-11-28
收藏
得分:0 
kdfjgksdj;lgkjs
2005-11-28 15:31
babybluecat
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-11-28
收藏
得分:0 
同问
我的一个程序也遇到了相同的问题,不知你的这个问题解决了没有
QQ:330123872
2005-11-28 15:34
honey0607
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-9-15
收藏
得分:0 

汗~~2X数。。


2005-11-29 11:34
honey0607
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-9-15
收藏
得分:0 
不如我重做!

2005-11-29 11:35
踏魔狼
Rank: 6Rank: 6
等 级:贵宾
威 望:24
帖 子:1322
专家分:33
注 册:2005-9-22
收藏
得分:0 
哎~~~在网吧上网帮不了你了。哎!!!!!

=×&D o I p R e E n C g T l X&×=
2005-12-02 14:46
快速回复:请高手帮忙调试一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019091 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved