随笔分类 - 数据结构
摘要:介绍 希尔排序也称缩小增量排序,属于插入排序中的一种排序算法,是在插入排序的基础上进行的改进,采用分组策略进行排序。 相关特点 时间复杂度:最好:O(n)、最坏:O(n2)、平均:O(n1.3) 辅助空间复杂度:O(1) 稳定性:不稳定 排序原理 希尔排序通过设定一个初始增量,将数组元素分组进行插入
阅读全文
摘要:C语言实现链队列 LinkQueue.h // // Created by Administrator on 2024/8/17. // #ifndef LINKQUEUE_H #define LINKQUEUE_H #include <stdbool.h> /** 定义队列元素结构体*/ type
阅读全文
摘要:链栈栈的实现方式 代码结构图 LinkElement.h #ifndef LINKSTACK_H #define LINKSTACK_H #include <stdbool.h> //定义数据类型 typedef int LinkElementType; /** 定义链栈的结点结构*/ typede
阅读全文
摘要:顺序栈的实现方式 代码结构图 Element.h typedef struct { int id; char * name; } ElementType; SeqStack.h #include <stdio.h> #include "Element.h" #include <stdbool.h>
阅读全文

浙公网安备 33010602011771号