- 博客(5)
- 收藏
- 关注
原创 队列的基本操作 出队 入队 判断队列是否为空 .......
#include <stdio.h> #include <malloc.h> #include<stdlib.h> #define MAXQSIZE 100 //最大队列长度,实际使用 MAXQSIZE-1 #define OVERFLOW 0 typedef int ElemType; typedef int Status; //循环队列(少用一个存储单元) typedef struct { ElemType base[MAXQSIZE];//初始化的动态分配存储空间
2021-10-30 14:58:35 4869
原创 栈的基本操作(初始化、判断栈是否为空、数制转换、出入栈、求栈中元素个数、获得栈顶元素值)
#include<stdio.h> //若用printf,scanf,getchar,putchar,gets,puts函数需包含该头文件 #include<stdlib.h> #include<malloc.h> //用malloc,free,realloc函数需包含该头文件 #include<conio.h> //若用getch()使得屏幕暂停,需包含该头文件 #define OVERFLOW 0; #define STACK_INIT_...
2021-10-27 19:29:50 5529 2
原创 单链表的基本操作 求表长、判断、打印、删除、插入、头插法建立单链表
#include<stdio.h> //若用printf,scanf,getchar,putchar,gets,puts函数需包含该头文件 #include<malloc.h> //用malloc,free,realloc函数需包含该头文件 #include<conio.h>//若用getch()使得屏幕暂停,需包含该头文件 #define MAX 1000 #define OK 0 typedef int ElemType;...
2021-10-27 19:27:15 401
原创 将顺序表中的元素存储在文本文件中
int j; fprintf(fp,"表名:La\n"); fprintf(fp,"表的元素:\n"); for(j=0;j<La.length;j++) fprintf(fp,"%d ",La.elem[j]); fprintf(fp,"\n"); fprintf(fp,"长度为:%d\n",La.length); fprintf(fp,"表名:Lb\n"); fprintf(fp...
2021-10-27 19:25:10 357
原创 顺序表的基本操作(顺序表定义、定位、插入、删除、合并、翻转)
#include<stdio.h> //若用printf,scanf,getchar,putchar,gets,puts函数需包含该头文件 #include<malloc.h> //用malloc,free,realloc函数需包含该头文件 #include<conio.h> //若用getch()使得屏幕暂停,需包含该头文件 #include <stdlib.h> #define OK 1; #define OVERFLOW -2 #de...
2021-10-11 22:47:16 749
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人