- 博客(5)
- 收藏
- 关注
原创 栈的顺序实现
#include <iostream> #include <iomanip> #define MAXSIZE 100 #define ADDSIZE 10 using namespace std; typedef int ElemType; typedef struct Stack { ElemType* base; ElemType* top; int length; }Stack; //初始化栈 int InitStack(Stack& L) { L.bas
2020-11-23 18:06:50 74
原创 线性表的顺序实现
#include <iostream> using namespace std; #define newsize 100 #define addsize 10 //构造线性表 typedef int ElemType; typedef struct { ElemType* elem; int length; int nowsize; }SqList; //初始化一个线性表 int InitList(SqList &L) { L.elem = (ElemType*)malloc
2020-11-23 18:03:42 44
原创 线性表的链式实现
#include <stdlib.h> #include <iostream> using namespace std; typedef struct Code { int data; struct Code* next; }Code, * Linklist; //初始化一个线性表 int Build(Linklist* L) { Linklist p; p = (Linklist)malloc(sizeof(Code)); p->next = NULL; *
2020-11-23 18:01:44 126
原创 求两个集合进行交差并运算的结果
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<iostream> using namespace std; typedef struct node { int data; struct node* next; }node, * List; //建表 void Build(List& L) { L = (List)malloc(sizeof(node)); int
2020-11-23 17:59:15 246
原创 队列的链式实现
用链式存储结构,实现教材定义的队列的基本操作。 菜单中包括以下功能: 1.初始化队列,2.销毁队列,3.清空队列,4. 队列判空,5.求队列长度,6.获取队头元素,7.插入一个 元素,8.删除一个元素,9输出所有元素。 要求:自定义的函数中不允许出现提示语和输出语句。 #include <iostream> using namespace std; typedef struct Code { struct Code* next; int data; }Code,* List; type
2020-11-23 17:32:34 80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人