数据结构
邱敬宝
这个作者很懒,什么都没留下…
展开
-
链队操作实现
其他头文件,见我的其他文章#include "Global.h"#include<stdio.h>#include<stdlib.h>//操作定义//初始化void InitLinkQueue(LinkQueue *queue){ //新建一个节点,让队列的头尾指针指向此节点 queue->front=queue->rear=malloc(sizeof(LinkNode)); //新申请的节点指向空 queue->re原创 2021-05-28 16:48:36 · 100 阅读 · 0 评论 -
数据结构之王道二叉树大题
notes:1.global存了一些结构体,定义见后边2.使用了队列,队列的操作的实现,见其他文章3.使用了数学库,编译命令类似于 gcc -g tree.c -o tree -lm#include <stdio.h>#include <string.h>#include <stdlib.h>//global存了一些结构体#include "Global.h"//使用了队列#include "LinkQueue.c"//使用了数学库,编译命令类似于原创 2021-05-28 16:46:55 · 294 阅读 · 0 评论 -
数据结构之王道链表大题
#include<stdio.h>#include<stdlib.h>typedef struct Node{ int data; struct Node *next;}Node,*PNode;//tips://PNode temp=node->next; 这样是个指针,指向某个节点,free(temp)是释放temp所指向节点的内容//PNode temp = (PNode) malloc(sizeof(Node)); 这样是先向系统申请了个no原创 2021-05-22 23:46:48 · 270 阅读 · 0 评论 -
数据结构之王道顺序表大题
#include<stdio.h>#define Maxsize 50typedef struct{ int data[Maxsize]; int length;} Seqlist;#pragma region 基础操作 //插入多个元素void InsertElements(Seqlist *seq,int data[],int count){ for (int i = 0; i < count; i++) { seq-&原创 2021-05-22 23:45:36 · 244 阅读 · 0 评论 -
数据结构之顺序表
开始学习数据结构,刚开始学没有一个整体的概念,学一点写一点吧!第一次更新链表之顺序表首先我们应该定义一个顺序表如果顺序表的元素只是数字的话,未免太单调了一些!所以,先定义一个数据类型来吧!!!typedef struct{ int id; char *name;//字符型指针,如果不太明白,请自行百度} ElementType;于是我们得到了一个叫做ElementTtype...原创 2019-06-07 23:50:35 · 143 阅读 · 0 评论