数据结构家谱管理系统

发布时间 : 星期一 文章数据结构家谱管理系统更新完毕开始阅读

int FamilyTree::DeletePeople(Node *root,string FatherName,string Deletepeople) //删除家族成员 { int t=0; Numberofpeople--; if(root==NULL) return t; else { if(root->==Deletepeople) //如果要删除的为祖先,则调用Release()函数 { t=1; root->brother=NULL; root->child=NULL; Release(root); } else { Node *Father=PreFindFather(root,FatherName); Node *Brother=PreFindBrother(root,FatherName); //兄弟结点 Node *p; Node *tree[20]; int top=0; while(root!=NULL||top!=0) { while(root!=NULL) { if(root->==Deletepeople) { p=root; //break; } top++; tree[top]=root; root=root->child; } if(top!=0) { root=tree[top]->brother; top--; } } if(toupper(p->=='Y') //健在人数减一 LifePeopele--; if(Father->child->==p->//Deletepeople) Father->child=NULL; else Brother->brother=NULL; //p->brother=NULL; //p->child=NULL; t=1; delete p; } } return t; } int flag=0; //标记 int FamilyTree::SetNewName(Node *root,string NAme,string NewName) //更改姓名 { if(root==NULL) return flag; else { if(root->==NAme) { flag=1; root->=NewName; } else { SetNewName(root->child,NAme,NewName); SetNewName(root->brother,NAme,NewName); } } return flag; } int FamilyTree::FindChild(Node *root,string NAme) //显示孩子信息 { int flag=0; if(root==NULL) return flag ;

联系合同范文客服:xxxxx#qq.com(#替换为@)