上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: /*增设tag数据,区分队满队空*/ #include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int front,rear,tag; }SqQueue; 阅读全文
posted @ 2020-06-27 18:50 石乐智先生 阅读(288) 评论(0) 推荐(0) 编辑
摘要: /*牺牲一个单元来区分队空队满*/#include<stdio.h>#define MaxSize 10typedef char ElemType;typedef struct { ElemType data[MaxSize]; int front,rear;}SqQueue;bool InitQu 阅读全文
posted @ 2020-06-27 17:41 石乐智先生 阅读(278) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int top; }SqStack; void InitStack(SqStack &s) //初 阅读全文
posted @ 2020-06-26 17:55 石乐智先生 阅读(400) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<malloc.h> typedef char ElemType; typedef struct DNode { ElemType data; struct DNode *prior; struct DNode *next; }DNode,*DLi 阅读全文
posted @ 2020-06-19 20:01 石乐智先生 阅读(197) 评论(0) 推荐(0) 编辑
摘要: /*头插法实现单链表逆置*/ #include<stdio.h> #include<malloc.h> typedef struct LNode { char data; struct LNode *next; }LNode,*LinkList; bool InitList(LinkList &L) 阅读全文
posted @ 2020-06-18 22:22 石乐智先生 阅读(677) 评论(0) 推荐(0) 编辑
摘要: /*单链表*/ #include<stdio.h> #include<malloc.h> typedef int ElemType; typedef struct LNode{ ElemType data; struct LNode *next; }LNode,*LinkList; bool Ini 阅读全文
posted @ 2020-06-18 21:25 石乐智先生 阅读(359) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #define MaxSize 10 typedef int ElemType; typedef struct{ ElemType data[MaxSize]; ElemType length; }SqList; void InitList(SqList &L) 阅读全文
posted @ 2020-06-17 20:26 石乐智先生 阅读(185) 评论(0) 推荐(0) 编辑
摘要: the before arrays: the after arrays: 1 2 3 4 13 9 5 15 6 7 8 14 10 6 29 10 11 12 15 11 7 313 14 15 16 16 12 8 4 阅读全文
posted @ 2019-08-21 18:28 石乐智先生 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 假定输入的字符串中只包含字母和*号。请编写函数fun,其功能是:除了尾部的*号之外,将字符中的其它的*号全部删除。 形参p已指向字符串中最后的一个字母。在编写函数时,不得使用C语言提供的字符串函数。 #include<stdio.h> void fun(char a[],char *p) { char ch=*p; p=a; //将p指向a while(*a!=ch) //遍历a至最后一个字母,如 阅读全文
posted @ 2019-08-18 18:50 石乐智先生 阅读(776) 评论(0) 推荐(0) 编辑
摘要: 学生的记录由学号和成绩组成,N名学生的数据已放入主函数中的结构体数组s中,请编写函数fun,其功能是: 按分数降序排列学生的记录,高分在前,低分在后*/ #include<stdio.h> #define N 16 typedef struct { char num[10]; int s; } STREC; void fun(STREC a[]) { int i,j; STREC p; for(i 阅读全文
posted @ 2019-08-16 16:23 石乐智先生 阅读(1213) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页