![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
haha_7
这个作者很懒,什么都没留下…
展开
-
C++实现数据结构-停车场管理
代码:#include<string.h> #include<ctype.h> #include<malloc.h> #include<limits.h> #include<stdio.h> #include<stdlib.h> #include<io.h> #include<math.h> #include<process.h> #include<iost原创 2020-12-10 21:50:03 · 921 阅读 · 1 评论 -
数据结构——删除x-y之间的元素
#include<stdio.h>#include<stdlib.h>#define max 100typedef struct{int a[max];int length;}SqList;int main(){ SqList L; L.length=0; int n,min,ma,k,i; printf("输入链表长度:"); scanf("%d",&n); while(n--) { scanf("%d",&L.a[L.l原创 2020-11-27 23:23:59 · 1293 阅读 · 0 评论 -
数据结构链表——删除值重复的结点
#include<stdio.h>#include<stdlib.h>#include<assert.h>typedef int Elemtype;typedef struct LNode{ Elemtype data; struct LNode *next;}LNode,*Linklist;void Init_Linklist(Linklist *L){ *L=(Linklist)malloc(sizeof(LNode)); assert(原创 2020-11-27 23:15:51 · 292 阅读 · 0 评论 -
数据结构——多项式相加、相减
多项式相加:#include<stdio.h>#include<stdlib.h>#define LEN sizeof(Poly)typedef struct term{ float xishu; int zhishu; struct term *next;}Poly,*Link;void CreatePolyn(Link *p,int m);void PrintPolyn(Link p);int cmp(Link p1, Link p2);Li原创 2020-11-27 23:07:50 · 2445 阅读 · 0 评论 -
数据结构——多项式相乘
#include<stdio.h>#include<stdlib.h>#include<math.h> #define LEN sizeof(Poly)typedef struct term{ float coef; int expn; struct term *next;}Poly,*Link;int LocateElem(Link p, Link s, Link &q); void Crea原创 2020-11-27 22:59:37 · 2114 阅读 · 0 评论 -
数据结构(二叉树查找)——二叉排序树的构造和查找、插入、删除
设计一个读入一串整数,然后构造二叉排序树,进行查找、插入、删除。#include <stdio.h>#include <stdlib.h>#define TRUE 1#define FALSE 0#define ENDKEY 0typedef int KeyType;typedef struct node{ KeyType key ; /*关键字的值*/ struct node *lchild,*rchild;/*左右指针*/}BSTNode, *BS原创 2020-11-27 22:49:52 · 3373 阅读 · 2 评论 -
数据结构(二叉树)——二叉树的建立、存储、遍历
建立二叉树,并通过调用函数,,输出先序遍历、中序遍历与后序遍历的结果#include <stdio.h>#include <stdlib.h>#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0//DataType 是二叉树数据元素类型,此程序定义为char型typedef char DataType;typedef struct Node{ Data原创 2020-11-27 22:40:24 · 857 阅读 · 0 评论 -
数据结构(栈与队列)——栈的顺序表示和实现、队列的链式表示和实现
实验内容:编写一个程序实现顺序栈的各种基本运算。实现队列的链式表示和实现。实验步骤:1.初始化顺序栈插入元素删除栈顶元素取栈顶元素遍历顺序栈置空顺序栈初始化并建立链队列入链队列出链队列遍历链队列1、栈的顺序表示和实现#include <stdio.h>#include <stdlib.h>#include <conio.h>#define TRUE 1#define FALSE 0#define OK原创 2020-11-27 22:32:45 · 2435 阅读 · 1 评论