自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(43)
  • 收藏
  • 关注

原创 动态规划-最长公共子串

动态规划-最长公共子串

2022-06-07 22:34:47 266 1

原创 动态规划-最长公共子序列LCS

动态规划-最长公共子序列LCS

2022-06-01 23:27:28 216

原创 动态规划-最长上升子序列LIS

动态规划-最长上升子序列LIS

2022-06-01 23:25:47 187

原创 动态规划-最大连续子序列和

动态规划-最大连续子序列和

2022-06-01 23:23:41 149

原创 动态规划-找零钱

/*Please enter the total number of coins:23Please enter the type and number of coins:3Please enter coin denomination:2 5 10dp[1]= -1 denomination = Can't scrape together coins!dp[2]= 1 denomination = 2dp[3]= -1 denomination = Can't scrape together co

2022-05-09 22:40:17 533

原创 递归,回溯-N皇后问题(3)位运算

# include <stdio.h># include <stdlib.h>char cols;//1个字节8位,1为该列有皇后0为没有short l_slash;//2个字节16位,1为该斜线有皇后0为没有short r_slash;//2个字节16位,1为该斜线有皇后0为没有int count;void NQueens(int n);void Place(int flag[], char cols, short l_slash, short r_slash, in

2022-03-18 21:22:30 205

原创 递归,回溯-N皇后问题(2)

# include <stdio.h># include <stdlib.h>int count;void NQueens(int n);void Place(int flag[], bool cols[], bool l_slash[], bool r_slash[], int n, int row);void Show(int flag[], int n);int main(void){ int n; printf("Please enter the ...

2022-03-18 21:19:13 362

原创 递归,回溯-N皇后问题(1)

# include <stdio.h># include <stdlib.h>void N_Queens(int n);void Place(int row, int n, int cols[]);bool CanPlace(int row, int col, int cols[]);void Show(int cols[], int n);int count;int main(){ int n; printf("Please enter the num...

2022-03-18 21:18:15 310

原创 C语言数据结构学习笔记(25)-哈希表链地址法

# include <stdio.h># include <string.h># include <windows.h># define MAX_SIZE 10# define HASH_SIZE 10typedef struct person{ char name[MAX_SIZE]; int age;}Person;typedef struct node{ Person * data; struct node * next...

2022-03-15 02:40:25 305

原创 C语言数据结构学习笔记(24)-哈希表开放定址法

#include <stdio.h>#include <windows.h># define M 10typedef struct hash{ int *elem;}HashTable;void Init(HashTable * H);void Insert(HashTable * H, int key);bool Search(HashTable * H, int key, int *addr);void Destory(HashTable * H);vo...

2022-03-14 22:06:28 1356

原创 C语言排序算法(10)- 桶排序

# include <stdio.h># include <windows.h># define N 1001int main(void){ int a[N], n, i, j, k; memset(a, 0, sizeof(a)); scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d", &k); a[k]++; }...

2022-03-11 23:33:44 1160

原创 C语言排序算法(9)- 基数排序

# include <stdio.h># include <windows.h># define len 10int FindMax(int a[], int n);void radixSort(int a[], int n);void countingSort(int a[], int n, int k);int main(void){ int a[] = {123, 85, 10, 90, 235, 150, 310, 3}; int n = siz...

2022-03-11 21:40:52 1406

原创 C语言排序算法(8)- 计数排序

#include <stdio.h>#include <time.h>#include <windows.h>void countingSort(int a[], int n);void countingSort2(int a[], int n);//优化排序void Findmax_min(int a[], int n, int *max, int *min);void Print(int a[], int n);int main(void){ ...

2022-03-11 21:24:03 940

原创 C语言排序算法(7)- 归并排序

#include <stdio.h>#include <windows.h>void merge(int a[], int b[], int start, int mid, int end);void mergeSort(int a[], int b[], int start, int end);//递归void mergeSort2(int a[], int b[], int n);//非递归void mergePass(int a[], int b[], int n,

2022-03-08 22:14:51 324

原创 C语言排序算法(6)- 堆排序

#include <stdio.h>#include <windows.h>void HeapSort(int *arr, int n);void HeapAdjust(int *arr, int n, int k);int main(void){ int n; printf("请输入待排序数字个数:"); scanf("%d", &n); int *arr = (int*)malloc(sizeof(int)*(n+1));...

2022-03-07 22:50:21 292

原创 C语言排序算法(5)- 选择排序

#include <stdio.h>#include <windows.h>void SelectSort(int * arr, int n);int main(void){ int arr[] = {7, 2, 5, 8, 9, 3}; int n = sizeof(arr)/sizeof(int); SelectSort(arr, n); for(int i = 0; i < n; i++) printf("%d ",...

2022-03-07 19:14:33 477

原创 C语言排序算法(4)- 快速排序

#include <stdio.h>#include <windows.h>void QuickSort(int *arr, int left, int right);int Partition(int *arr, int left, int right);int main(void){ int arr[] = {5, 1, 9, 3, 7, 4, 8, 6, 2}; int n = sizeof(arr)/sizeof(int); QuickSor...

2022-03-04 22:26:20 463

原创 C语言排序算法(3)- 冒泡排序

#include <stdio.h>#include <windows.h>void BubbleSort(int * arr, int n);void BubbleSort2(int * arr, int n);int main(void){ int arr[] = {8, 5, 2, 6, 4, 3, 7, 1}; int n = sizeof(arr)/sizeof(int); BubbleSort(arr, n); for(int i...

2022-03-03 00:36:38 409

原创 C语言排序算法(2)-希尔排序

# include<stdio.h># include<windows.h>void ShellSort(int * arr, int n);int main(void){ int arr[] = {8, 5, 10, 3, 15, 1, 6, 2, 12}; int n = sizeof(arr)/sizeof(int); ShellSort(arr, n); for(int i = 0; i < n; i++) { ...

2022-03-02 21:44:00 315

原创 C语言排序算法(1)-直接插入排序和二分插入排序

/*直接插入排序和二分插入排序8 5 10 6 15 11 5 6 8 10 15请按任意键继续. . .*/# include <stdio.h># include <windows.h>void InsertSort(int * arr, int n);//直接插入排序void InsertSortBS(int * arr, int n);//二分插入排序int main(void){ int arr[] = {8, 5, 10, 6, 15...

2022-03-01 23:48:44 432

原创 C语言数据结构学习笔记(23)-平衡二叉树-AVL树创建及删除

/*平衡二叉树-AVL树创建及删除请输入待创建AVL树结点个数:10请依次输入结点信息:3Root = 3请依次输入结点信息:2Root = 3请依次输入结点信息:1Root = 2请依次输入结点信息:4Root = 2请依次输入结点信息:5Root = 2请依次输入结点信息:6Root = 4请依次输入结点信息:7Root = 4请依次输入结点信息:10Root = 4请依次输入结点信息:9Root = 4请依次输入结点信息:8Root = 4中序:1(1)2(

2021-12-29 21:28:33 741

原创 C语言数据结构学习笔记(22)-AOE网关键路径

AOE网关键路径

2021-11-26 00:21:44 299

原创 C语言数据结构学习笔记(21)-AOV网拓扑排序

AOV网拓扑排序

2021-11-24 00:03:05 554

原创 C语言数据结构学习笔记(20)-有向网图的最短路径-Floyd算法及路径打印

有向网图的最短路径-Floyd算法及路径打印

2021-11-21 22:55:47 1018

原创 C语言数据结构学习笔记(19)-有向网图的最短路径-Dijkstra算法及路径打印

有向网图的最短路径-Dijkstra算法及路径打印

2021-11-20 01:01:06 1398

原创 C语言数据结构学习笔记(18)-无向网图的DFS和BFS遍历及最小生成树Prim、Kruskal算法

无向网图的DFS和BFS遍历及最小生成树Prim、Kruskal算法

2021-11-16 00:09:43 1230

原创 C语言数据结构学习笔记(17)-无向图的邻接表

/*无向图的邻接表输出结果请输入待创建图的顶点数和边数:4 4请输入第1个顶点信息:a请输入第2个顶点信息:b请输入第3个顶点信息:c请输入第4个顶点信息:d请输入第1条边的两个顶点对应的下标值:0 1请输入第2条边的两个顶点对应的下标值:0 3请输入第3条边的两个顶点对应的下标值:1 3请输入第4条边的两个顶点对应的下标值:1 2a (a,d) (a,b)b (b,c) (b,d) (b,a)c (c,b)d (d,b) (d,a)请按任意键继续. . .*/# inc

2021-11-10 00:35:56 517

原创 C语言数据结构学习笔记(16)-无向图的邻接矩阵及遍历

/*无向图的邻接矩阵输出结果:请输入图的顶点个数和边的个数:4 4请输入各顶点数据:V0请输入各顶点数据:V1请输入各顶点数据:V2请输入各顶点数据:V3请依次输入边的两个顶点编号:0 1请依次输入边的两个顶点编号:0 3请依次输入边的两个顶点编号:1 3请依次输入边的两个顶点编号:1 2 V0 V1 V2 V3V0 0 1 0 1V1 1 0 1 1V2 0 1 0 0V3 1 1 0 0请按任意键继续. ...

2021-11-10 00:33:23 628

原创 C语言数据结构学习笔记(15)-哈夫曼树的创建及哈夫曼编码

/*哈夫曼编码输出结果:请输入初始结点个数:5请输入5个权值:2 5 7 8 6最小元素为2下标为0, 次小元素为5下标为1最小元素为6下标为4, 次小元素为7下标为2最小元素为7下标为5, 次小元素为8下标为3最小元素为13下标为6, 次小元素为15下标为7下标 weight parent lchild rchild0 2 5 -1 -11 5 5 -1 -12 7 ...

2021-11-07 21:11:46 1799

原创 C语言数据结构学习笔记(14)-哈夫曼树的创建及遍历

/*哈夫曼树的创建及遍历输出结果:请输入结点个数:5请输入权值:2 5 7 8 6最小下标:0 值为2, 次小下标:1 值为5最小下标:4 值为6, 次小下标:2 值为7最小下标:5 值为7, 次小下标:3 值为8最小下标:6 值为13, 次小下标:7 值为15下标 weight parent lchild rchild0 2 5 -1 -11 5 5 -1 -12 7...

2021-11-05 22:56:44 901 1

原创 C语言数据结构学习笔记(13)-线索二叉树中序不带头结点的遍历

/*线索二叉树中序不带头结点的遍历输出结果:ABDF##G###C#E##中序遍历线索二叉树:F D G B A C E中序遍历线索二叉树逆序:E C A B G D F请按任意键继续. . .*/# include <stdio.h># include <stdlib.h>typedef enum {Link, Thread} PointerTag;//Link为0表示有左右孩子结点,Thread为1表示设置前驱或者后继结点# define ElemType

2021-11-04 00:01:00 619

原创 C语言数据结构学习笔记(12)-线索二叉树的创建和遍历

/*线索二叉树输出结果:ABDF##G###C#E##中序遍历:F D G B A C E中序遍历逆序:E C A B G D F请按任意键继续. . .*/# include <stdio.h># include <stdlib.h>typedef enum {Link, Thread} PointerTag;//Link为0表示指向左右孩子结点,Thread为1表示设置前驱或后继结点# define ElemType chartypedef struct

2021-11-03 01:12:45 336

原创 C语言数据结构学习笔记(11)-二叉排序树的创建遍历及删除

/*二叉排序树的创建遍历及删除输出结果:中序遍历:1 2 4 5 6 7 9 10 14 15 17 18 19 20 25 30 35 40层序遍历:20 14 25 5 15 35 4 10 17 30 40 2 6 19 1 9 18 7Treeheight = 7请输入待寻找的数字:5找到了5.请输入待寻找父节点的数字:55的父节点值为14请输入要删除的节点值:5删除后root = 2...

2021-10-29 00:13:39 511

原创 C语言数据结构学习笔记(10)-二叉树的创建及遍历

/*二叉树的创建及遍历输出结果:请输入待创建的二叉树:ABD##E##CF###前序遍历:A B D E C F 中序遍历:D B E A F C 后序遍历:D E B F C A 层序遍历:A B C D E F请按任意键继续. . .*/# include <stdio.h># include <stdlib.h># define ElemType char# define MAX_SIZE 20# define bool int# define true

2021-10-28 02:59:10 354

原创 C语言数据结构学习笔记(9)-稀疏矩阵的三元组加乘法、转置

/*稀疏矩阵的三元组顺序表基本表示及加乘法、转置输出结果为:请输入第一个稀疏矩阵的行数,列数,非零元素个数:3 3 3请输入稀疏矩阵的行数,列数,非零元素值:1 1 1请输入稀疏矩阵的行数,列数,非零元素值:2 2 2请输入稀疏矩阵的行数,列数,非零元素值:3 1 3输出三元组数组:Row Col Item1 1 12 2 23 1 3输出稀疏矩阵:1 0 00 ...

2021-10-20 03:20:23 1401 1

原创 C语言数据结构学习笔记(8)-稀疏矩阵的三元组顺序表

/*稀疏矩阵的三元组顺序表基本表示输出结果为:请输入稀疏矩阵的行数,列数,非零元素个数:5 5 4请输入稀疏矩阵的行数,列数,非零元素值:1 2 1请输入稀疏矩阵的行数,列数,非零元素值:5 3 5请输入稀疏矩阵的行数,列数,非零元素值:3 2 3请输入稀疏矩阵的行数,列数,非零元素值:2 4 2输出三元组数组:Row Col Item1 2 12 4 23 2 35 3 ...

2021-10-19 20:51:16 1491 1

原创 C语言数据结构学习笔记(7)-链式队列

/*链式队列输出结果:入队成功,入队元素为a队首元素为a入队成功,入队元素为b队首元素为a入队成功,入队元素为c队首元素为a入队成功,入队元素为d队首元素为a入队成功,入队元素为e队首元素为a队列元素个数为5队列中的元素为: a b c d e出队成功,出队元素为a队首元素为b队列元素个数为4出队成功,出队元素为b队首元素为c队列元素个数为3出队成功,出队元素为c队首元素为d队列元素个数为2出队成功,出队元素为d队首元素为e队列元素个数为1出队成功,出队元

2021-09-28 22:37:12 600

原创 C语言数据结构学习笔记(6)-循环队列-数组实现

/*循环队列-数组实现输出结果:入队成功,入队元素为a.入队成功,入队元素为b.入队成功,入队元素为c.入队成功,入队元素为d.入队失败,队列已满.队列元素个数为4.队列中的元素为:a b c d出队成功,出队元素为a.获取成功,队首元素为b.队列元素个数为3.队列中的元素为:b c d队列已清空.队列元素个数为0.队列为空.入队成功,入队元素为e.队列元素个数为1.队列中的元素为:e队列已经销毁.请按任意键继续. . .*/# include <stdio.

2021-09-28 00:45:45 264

原创 C语言数据结构学习笔记(5)-链栈迷宫问题DFS显示

# include <stdio.h># include <stdlib.h># include <windows.h># define bool int# define true 1# define false 0# define M 18# define N 18# define SIZE 4//方向试探typedef struct Direction{ int incX, incY;//x, y方向的增量即行和列}Direction;...

2021-09-27 22:01:46 212

原创 C语言数据结构学习笔记(4)-链栈

/* 链栈输出结果:栈内元素为:c b a栈顶元素为c.出栈成功,出栈的元素为c.出栈成功,出栈的元素为b.出栈成功,出栈的元素为a.出栈失败,栈为空请按任意键继续. . .*/# include <stdio.h># include <stdlib.h># define bool int# define true 1# define false 0# define ElemType chartypedef struct Node{ ElemTy...

2021-09-27 21:55:46 198

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除