- 1、本文档共33页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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++;
感谢下载载
精品
//
您可能关注的文档
- 《恐龙列车》谱(最新版).doc
- 《昆虫记》名著导读教学设计(最新版).doc
- 《昆虫记》名著阅读及练习答案(最新版).doc
- 《昆虫记》阅读题(最新版).doc
- 《昆虫记》阅读指导课(最新版).doc
- 《昆虫记》知识点(最新版).doc
- 《社区护理学》习题(最新版).doc
- 《中华民族精神》检测答案(最新版).doc
- Alpha谱仪实验(最新版).doc
- AVI外观检测设备知识(最新版).doc
- 中国国家标准 GB/T 18233.4-2024信息技术 用户建筑群通用布缆 第4部分:住宅.pdf
- GB/T 18233.4-2024信息技术 用户建筑群通用布缆 第4部分:住宅.pdf
- GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计.pdf
- 《GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计》.pdf
- 中国国家标准 GB/T 18978.210-2024人-系统交互工效学 第210部分:以人为中心的交互系统设计.pdf
- GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置.pdf
- 《GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置》.pdf
- 中国国家标准 GB/T 16649.2-2024识别卡 集成电路卡 第2部分:带触点的卡 触点的尺寸和位置.pdf
- GB/T 17889.4-2024梯子 第4部分:铰链梯.pdf
- 《GB/T 17889.4-2024梯子 第4部分:铰链梯》.pdf
文档评论(0)