
数据结构
文章平均质量分 95
鱼7s later 재생
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
红黑树实现
文章目录前言一, 函数调用流程及插入删除总结二, 最终代码实现三, 二叉排序树的实现1 ,二叉排序树的节点插入:2,二叉排序树的节点删除:(1)如果待删除节点没有左右子孩子(2) 待删除节点只有左孩子(3) 待删除节点只有右孩子(4) 待删除节点有左右两个孩子(5)删除节点的代码实现3,二叉排序树插入与删除节点的代码实现四, 由二叉排序树到红黑树一, 加入记录颜色的元素二, 插入节点后对红黑树五条基本性质的维护1. 插入节点的颜色2. 左旋和右旋3. 插入和调整节点过程中导致失衡的情况情况一情况二4,插入.原创 2021-01-28 00:59:47 · 1036 阅读 · 1 评论 -
线性建堆法与堆排序
#include <stdio.h>#include <time.h>#include <stdlib.h>#define swap(a,b) {\ __typeof(a) temp = a;\ a = b; b = temp;\}void update(int num[],int begin,int end){ int cur = begin,max = begin; if(cur * 2 <= end &&a原创 2020-11-30 11:47:13 · 805 阅读 · 0 评论 -
c语言数组实现队列
#include <stdio.h>#include <stdlib.h>#include <time.h>typedef struct queue{ int *data,head,tail,size,count;} queue;queue *init(int );void clear(queue *);int push(queue *,int );int pop(queue *);void output(queue *);int empty(q原创 2020-11-13 10:08:19 · 380 阅读 · 0 评论 -
c语言实现链表
#include <stdio.h>#include <stdlib.h>#include <time.h>typedef struct Node{ int data; struct Node *next;} Node;typedef struct List{ int length; Node *head;} List;List *init();void clear(List *);Node *new_node(int );int ins原创 2020-11-12 22:21:07 · 97 阅读 · 0 评论 -
c语言实现顺序表
#include <stdio.h>#include <stdlib.h>#include <time.h>typedef struct{ int *data,size,length;} Arr;Arr *init(int n){ //初始化一个顺序表 Arr *res=(Arr *)calloc(1,sizeof(Arr)); res->data=(int *)calloc(n,sizeo原创 2020-11-12 19:10:58 · 93 阅读 · 0 评论