第一范文网 - 专业文章范例文档资料分享平台

数据结构家谱管理系统

来源:用户分享 时间:2025/11/19 20:07:36 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

{ if(root!=NULL) numberofpeople++; NumberOfPeople(root->child); NumberOfPeople(root->brother); } return numberofpeople;*/ else return Numberofpeople; } //int count=0; int FamilyTree::LifeNum( ) //健在人数 { if(root==NULL) //-1表示这个家族不存在 return -1; /*else { if(toupper(root->=='Y') count++; LifeNum(root->child); LifeNum(root->brother); } return count;*/ return LifePeopele; } void FamilyTree::PrintMessage(Node *root ) //输出基本信息 { if(root==NULL) return ; else { cout<<\姓名:\ cout<<\性别:\ cout<<\配偶:\ cout<<\出生地:\ cout<<\生日:\ cout<<\父亲:\ cout<<\学历:\ cout<<\工作:\ cout<<\是否健在:\ if(toupper(root->=='Y') cout<<\是\ else cout<<\否\ } } int message=0; //判断是否查找成功 int FamilyTree::Message(Node *root,string Name) //显示该成员的基本信息 { if(root==NULL) return message; else { if(root->==Name) { message=1; PrintMessage(root ); } else { Message(root->child,Name); Message(root->brother,Name); } } return message; } Node* FamilyTree::PreFindFather(Node *root,string FatherName) //给定元素值查找父亲结点指针位置并返回其指针,此方法采用的先序遍历 { if(root==NULL) throw\错误\ Node *p; Node *tree[20]; int top=0; while(root!=NULL||top!=0) { while(root!=NULL) { if(root->==FatherName) p=root; top++;

搜索更多关于: 数据结构家谱管理系统 的文档
数据结构家谱管理系统.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c85xey5z4739mzf00wrvr0a0pl1szsm00hkr_8.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top