![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构学习笔记
以《数据结构 C语言实现》严蔚敏等著 和 《数据结构算法解析》高一凡著两书为核心学习整理
JUSTfFUN
竭尽此生,摆脱愚昧
展开
-
郝斌_数据结构_快速排序源代码
郝斌《数据结构》课程源代码快速排序的实现用者自取,自由分享/* * 时间:2021.01.25 * 内容:快速排序 */#include <stdio.h>void QuickSort(int * , int , int );int FindPos(int * , int , int );int main(void){ int a[6] = {2, 1, 0, 5, 4, 3}; int i; QuickSort(a, 0, 5); //第二个参数表示第一个元原创 2021-02-09 15:05:56 · 117 阅读 · 0 评论 -
郝斌_数据结构_树源代码
郝斌《数据结构》课程源代码树的实现用者自取,自由分享/* * 时间:2021.01.25 * 内容:链式二叉树遍历具体程序演示 */#include <stdio.h>struct BTNode{ char data; struct BTNode * pLchild; //p是指针,L是左,child是孩子 struct BTNode * pRchild;};struct BTNode * CreatBTree(void);void PreTraverseBT原创 2021-02-09 15:04:46 · 212 阅读 · 0 评论 -
郝斌_数据结构_递归源代码
郝斌《数据结构》课程源代码递归的实现用者自取,自由分享阶乘的循环实现/* * 时间:2021.01.21 * 内容:阶乘的循环实现 */#include <stdio.h>int main(void){ int val; int i, s, mult =1; printf("请输入一个数字:"); printf("val = "); scanf("%d", &val); for(i = 1; i <= val; ++i) { mu原创 2021-02-09 15:03:37 · 143 阅读 · 0 评论 -
郝斌_数据结构_队列源代码
郝斌《数据结构》课程源代码队列的实现用者自取,自由分享#include <stdio.h>#include <malloc.h>typedef struct Queue{ int * pBase; int front; int rear;}QUEUE;void init(QUEUE *);bool en_queue(QUEUE *, int);void traverse_queue(QUEUE *);void full_queue(QUEUE *);原创 2021-02-09 14:59:44 · 164 阅读 · 0 评论 -
郝斌_数据结构_栈源代码
郝斌《数据结构》课程源代码栈的实现用者自取,自由分享/* * 时间:2021.01.14 * 内容:栈程序演示 */#include <stdio.h>#include <malloc.h>#include <stdlib.h>typedef struct Node{ int data; struct Node * pNext;}NODE, * PNODE;typedef struct Stack{ PNODE pTop;原创 2021-02-09 14:58:56 · 187 阅读 · 0 评论 -
郝斌_数据结构_链表源代码
郝斌《数据结构》课程源代码链表的实现用者自取,自由分享#include <stdio.h>#include <malloc.h>#include <stdlib.h>typedef struct Node{ int data; //数据域 struct Node * pNext; //指针域}NODE, *PNODE; //NODE等价于struct Node PNODE等价于struct Node *//函数声明PNODE create_原创 2021-02-09 14:57:59 · 360 阅读 · 2 评论 -
郝斌_数据结构_连续存储数组源代码
郝斌《数据结构》课程源代码连续存储数组的实现用者自取,自由分享/*时间:2020.12.28内容:连续存储数组的算法演示*/#include <stdio.h>#include <malloc.h>#include <stdlib.h>struct Arr{ int * pBase; //储存的是第一个元素的地址 int len; //数组所能容纳的最大元素的个数 int cnt; //当前数组有效元素的个数 //int inc原创 2021-02-09 14:55:32 · 323 阅读 · 1 评论 -
郝斌_数据结构入门笔记
该笔记与郝斌《数据结构》视频课程相同用者自取,自由分享原创 2021-02-09 14:42:20 · 1388 阅读 · 1 评论 -
顺序表_归并顺序表举例
顺序表的归并举例说明已知:顺序线性表La和Lb的元素按值非递减排序要求:归并La和Lb得到新的顺序线性表Lc,Lc的元素也按值非递减排序(不改变表La和表Lb)以下内容保存在algo2-1.cpp/* * 时间:2021.01.30 * 内容:实现算法2.7 * 算法2.7: * 已知顺序线性表La和Lb的元素按值非递减排序 * 归并La和Lb得到新的顺序线性表Lc,Lc的元素也按值非递减排序(不改变表La和表Lb) */#include "c1.h"typedef int原创 2021-02-07 18:01:20 · 396 阅读 · 0 评论 -
顺序表_主程序
顺序表检验bo2-1.h的主程序以下内容为main2-1.cpp/* * 时间:2021.01.30 * 内容:检验 bo2-1.h 的主函数,也是线性表主要功能检验主函数 * 位置: * 高书p15 */#include "c1.h"typedef int ElemType; // 定义ElemType为整型#include "c2-1.h" //线性表的顺序存储结构#include "bo2-1.h" //线性表顺序存储结构的基本操作#include "fun2-2.原创 2021-02-07 17:52:07 · 422 阅读 · 0 评论 -
顺序表_常用函数
常用函数以下内容为func2-2.h文件/* * 时间:2021.01.30 * 内容:顺序表的常用函数 * 位置: * 高书p15 */Status equal(ElemType c1, ElemType c2){//判断是否相等的函数 if(c1 == c2) { return TRUE; } else { return FALSE; }}int comp(ElemType a, ElemType b){//根据a <,=或>b,分别返回-原创 2021-02-07 17:48:41 · 258 阅读 · 0 评论 -
顺序表_基本操作
顺序表的基本操作以下内容为bo2-1.h文件 /* * 时间:2021.01.28 * 内容:顺序存储的线性表的基本操作(12个) * 位置: * 严书P25-P29 高书P11 */ /* * 顺序表的初始化伪算法: * Status InitList(SqList &L) * {//构造一个空的顺序表L * L.elem = new ElemType(MAXSIZE); //为顺序表分配一个大小为MAXSIZE的数组空间 * if(!L.e原创 2021-02-07 17:45:31 · 466 阅读 · 0 评论 -
顺序表_存储结构
/* * 时间:2021.01.28 * 内容:线性表的动态分配顺序存储结构 * 位置: * 严书P23 高书P11 *//*伪算法:#define MAXSIZE 100 // 顺序表可能达到的最大长度typedef struct{ ElemType * elem; // 储存空间的基地址 int length; // 当前长度}SqList; // 顺序表的结构类型为SqList*/#define LIST_INIT_SIZE 10 //线性表存储空间的初始分原创 2021-02-07 17:38:01 · 434 阅读 · 0 评论 -
状态代码定义和常用头文件
高书P1,2严书定义OK,ERROR等为函数的结果状态代码,Status为其类型,把这些信息放到头文件c1.h中。//状态代码定义和常用头文件//高书P2#include <string.h> //字符串函数#include <ctype.h> //字符函数#include <malloc.h> //malloc()函数等#include <limits.h> //INR_MAX等#include <stdio.h> //标准输入原创 2021-02-07 16:50:10 · 1374 阅读 · 0 评论 -
数据结构学习笔记说明
1.本文为数据结构学习笔记2.核心书目为《数据结构 C语言实现》 第二版 严蔚敏等著 和 《数据结构算法解析》 高一凡著3.附带在VS2019下编译通过的C/C++源代码原创 2021-02-07 16:45:58 · 169 阅读 · 0 评论