没有合适的资源?快使用搜索试试~ 我知道了~
广东工业大学数据结构anyview代码第二章
试读
21页
5星 · 超过95%的资源 需积分: 0 211 下载量 178 浏览量
更新于2023-01-25
12
收藏 50KB DOCX 举报
内容包括广东工业大学数据结构anyview的相关练习第二章,能力有限给大家一个参考
目录
第二章 ......................................................................................................................................2
DC02PE03..........................................................................................................................2
DC02PE05..........................................................................................................................2
DC02PE07..........................................................................................................................2
DC02PE11..........................................................................................................................3
DC02PE13..........................................................................................................................3
DC02PE15..........................................................................................................................3
DC02PE17..........................................................................................................................4
DC02PE19..........................................................................................................................4
DC02PE20..........................................................................................................................5
DC02PE21..........................................................................................................................5
DC02PE23..........................................................................................................................7
DC02PE25..........................................................................................................................7
DC02PE27..........................................................................................................................8
DC02PE32..........................................................................................................................8
DC02PE33..........................................................................................................................9
DC02PE35........................................................................................................................10
DC02PE45........................................................................................................................10
DC02PE53........................................................................................................................10
DC02PE55........................................................................................................................11
DC02PE61........................................................................................................................11
DC02PE63........................................................................................................................12
DC02PE68........................................................................................................................12
DC02PE71........................................................................................................................13
DC02PE73........................................................................................................................13
DC02PE75........................................................................................................................14
DC02PE77........................................................................................................................14
DC02PE82........................................................................................................................15
DC02PE84........................................................................................................................15
DC02PE86........................................................................................................................16
DC02PE88........................................................................................................................17
DC02PE91........................................................................................................................18
DC02PE93........................................................................................................................19
DC02PE94........................................................................................................................20
DC02PE97........................................................................................................................20
第二章
DC02PE03
#include "allinclude.h" //DO NOT edit this line
Status StackEmpty_Sq(SqStack S) {
if(S.top!=NULL)return FALSE;
else return TRUE;
}
DC02PE05
#include "allinclude.h" //DO NOT edit this line
Status GetTop_Sq(SqStack S, ElemType &e) {
// Add your code here
if(S.top!=NULL)
{
e=S.elem[S.top-1];
return OK;
}
return ERROR;
}
DC02PE07
#include "allinclude.h" //DO NOT edit this line
Status Pop_Sq(SqStack &S, ElemType &e) {
// Add your code here
if(S.top==0)return ERROR;
e=S.elem[S.top-1];
S.top--;
return 1;
}
DC02PE11
#include "allinclude.h" //DO NOT edit this line
Status InitStack_Sq2(SqStack2 &S, int size, int inc) {
// Add your code here
S.elem=(ElemType*)malloc(sizeof(ElemType));
if(S.elem==NULL)return 0;
if(size<1)return 0;
if(inc<1)return 0;
S.top=&S.elem[0];
S.size=size;
S.increment=inc;
return 1;
}
DC02PE13
#include "allinclude.h" //DO NOT edit this line
Status StackEmpty_Sq2(SqStack2 S) {
// Add your code here
if(S.top!=S.elem)return 0;
return 1;
}
DC02PE15
#include "allinclude.h" //DO NOT edit this line
Status Push_Sq2(SqStack2 &S, ElemType e) {
// Add your code here
if(S.top==S.elem+S.size)
{
realloc(S.elem,(S.size+S.increment)*sizeof(ElemType));
if(S.elem!=NULL)
{
S.elem[S.size]=e;
S.size+=S.increment;
S.top++;
return 1;
}
else return 0;
}
else
*S.top=e;
S.top++;
return 1;
}
DC02PE17
#include "allinclude.h" //DO NOT edit this line
Status Pop_Sq2(SqStack2 &S, ElemType &e) {
// Add your code here
if(S.elem==S.top)return 0;
e=*(S.top-1);
*S.top--;
return 1;
}
DC02PE19
#include "allinclude.h" //DO NOT edit this line
Status CopyStack_Sq(SqStack S1, SqStack &S2) {
// Add your code here
//if(StackEmpty_Sq(S1)==TRUE)return 1;
SqStack a;
ElemType j;
InitStack_Sq(a,S1.size,S1.increment);
InitStack_Sq(S2,S1.size,S1.increment);
a.top=0;
S2.top=0;
if(StackEmpty_Sq(S1)==TRUE)return 1;
int n= S1.top;
for(int i=0;i<n;i++)
剩余20页未读,继续阅读
资源推荐
资源评论
118 浏览量
5星 · 资源好评率100%
139 浏览量
107 浏览量
5星 · 资源好评率100%
125 浏览量
5星 · 资源好评率100%
155 浏览量
资源评论
- 舒心纯子2023-09-22学长赛高!Daisuki!
想要AC的dly
- 粉丝: 7078
- 资源: 35
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 白色风格的购物商城网站模板下载.zip
- 白色风格的后台管理模板整站下载.zip
- 白色风格的后台管理系统模板下载.rar
- 白色风格的生活社区网站模板下载.zip
- 白色风格的商务网站模板下载.rar
- 白色风格的手机网站模板下载.rar
- 白色风格的直播平台模板整站下载.zip
- 白色大气风格的商务会议活动模板下载.rar
- 白色大气风格的商务网站模板下载.rar
- 白色大气风格的商务团队公司模板下载.zip
- 白色大气风格的商业办公楼租赁模板下载.zip
- 白色大气风格的商业html5模板.zip
- 白色大气风格的商务英语学习培训网站模板.zip
- 白色大气风格的商业公司模板下载.zip
- 白色大气风格的商业代理公司模板下载.zip
- 白色大气风格的商业策划公司模板下载.zip
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功