无损连接(最新版).doc

  1. 1、本文档共33页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
精品 #includeiostream #includestdlib.h using namespace std; int Backup[20][20]; int Get_CLong(char* A_Char);// 计算字符串的长度 struct Function { char set_left[20]; int left; char set_right[20]; int right; Function *next; }; class Function_Set { private: Function* head; public: Function_Set();// 构造函数 void Add_Function(char*,int,char*,int);// 建立新的关系结点 Function* Get_Head();// 返回头结点 感谢下载载 精品 void Output();// 输出 }; Function_Set::Function_Set() {// 构造函数 head=NULL; //head-next=NULL; } void Function_Set::Add_Function(char*t_sleft,int t_left,char*t_sright,int t_right) {// 增加一个关系结点 Function* temp1=new Function(); for(int i=0;it_left;i++) {// 左赋值 temp1-set_left[i]=t_sleft[i]; } temp1-left=t_left; for(int i=0;it_right;i++) {// 右赋值 temp1-set_right[i]=t_sright[i]; } temp1-right=t_right; if(head==NULL) { 感谢下载载 精品 head=temp1; head-next=NULL; } else { Function*temp2=new Function; temp2=head; while(temp2-next!=NULL) { temp2=temp2-next; } temp1-next=temp2-next; temp2-next=temp1; } } Function* Function_Set::Get_Head() { return head; } void Function_Set::Output() {// 输出 if(head==NULL) 感谢下载载 精品 { exit(1); } else { Function* temp1=new Function; temp1=head; while(temp1!=NULL) { for(int i=0;itemp1-left;i++) { couttemp1-set_left[i]; } cout-; for(int i=0;itemp1-right;i++) { couttemp1-set_right[i]; } coutendl; temp1=temp1-next; } } 感谢下载载 精品 } struct Devide {// 构建一个分解的子关系 char dev[20]; int table; Devide* next; }; class Devide_Set { private: Devide* head; int DS_table; public: Devide_Set();// 构造函数 Devide* Get_Head();// 返回头结点 int Get_Long();// 返回链表长度 void Add_Devide(char*);// 增加子关系 void Output();// 输出 }; Devide_Set::Devide_Set() {// 构造函数 感谢下载载 精品 head=NULL; DS_table=0; } Devide* Devide_Set::Get_Head() {// 返回头结点 return head; } int Devide_Set::Get_Long() {// 返回链表长度 return DS_table; } void Devide_Set::Add_Devide(char* C_temp1) {// 增加子关系 Devide* D_temp1=new Devide; int I_temp1; I_temp1=Get_CLong(C_temp1); for(int i=0;iI_temp1;i++) { D_temp1-dev[i]=C_temp1[i]; } D_temp1-table=DS_table; DS_table++; 感谢下载载 精品 //

文档评论(0)

xiaoleige1916 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档