| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 416 人关注过本帖
标题:一切都正常,只在最后一步运行出不能读
取消只看楼主 加入收藏
iambeliveble
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2009-9-2
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:0 
一切都正常,只在最后一步运行出不能读
#include<iostream.h>
 template<class T>
     struct BiNode
 {
     T data;
     BiNode<T> *lchild,*rchild;
 };
template<class T>
class erchashu
{
public:
    erchashu(int a[],int n);
    void insert(BiNode<T> *root,BiNode<T> *s);
private:
    BiNode<T> *root;
    BiNode<T> *s;
};
template<class T>
void erchashu<T>::insert(BiNode<T> *root,BiNode<T> *s)
{
    if(root==NULL)
        root=s;
    else if(s->data<root->data) insert(root->lchild,s);
          else insert(root->rchild,s);
}
template<class T>
erchashu<T>::erchashu(int a[],int n)
{
    for(int i=0;i<n;i++)
    {
        s=new BiNode<T>;s->data=a[i];
        s->lchild=s->rchild=NULL;
        insert(root,s);
    }
}
void main()
{
    int we[]={53,12,26,56,89,15,42,36};
    erchashu<int> b(we,8);
   
}
一切都正常,只在最后一步运行出不能读,什么原因
搜索更多相关主题的帖子: 运行 
2009-09-07 17:19
快速回复:一切都正常,只在最后一步运行出不能读
数据加载中...
 
   



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

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