- 博客(15)
- 收藏
- 关注
转载 python复习资料转载
转自 https://blog.csdn.net/qq_39384184/article/details/86323960 2019 12/28 大三上
2019-12-28 23:28:00
221
原创 python基础知识点
1系列解包赋值 左右个数必须保持一致 a,b =b,a实现交换 2变化参数 函数传值*是一个turple def func(kargs): print(kargs) a,b,c=1,2,3 func(a,b,c) (1, 2, 3) *是一个字典, def func(kargs): for i in kargs: print(kargs.get(i)) func(a=1,b=2,c=4) 1,2,...
2019-12-28 13:56:43
173
原创 表的创建 邻接矩阵邻接表
#include using namespace std; //邻接矩阵 #define MAXV typedef int VertexType; typedef struct VertexType; //头顶点 { int no; InfoType info; }; typedef struct MGraph //邻接矩阵类型 适合存储图的稀疏矩阵 { int edges[MAXV][MA...
2019-03-19 22:17:20
115
原创 希尔排序
#include using namespace std; void Hell(int arr[],int n) {//gap为一个增量,增量的求法为:数组的长度除以2,得到一个gap值,然后再用gap除以2,直到为1,这几个结果 //称为增量(如果结果为小数,则向下取整,增量也是步长) for (int gap = n / 2; gap >= 1; gap = gap / 2) { //...
2018-12-28 17:57:16
90
原创 基数排序
#include using namespace std; int getMax(int num[], int n) //返回num数组中最大的一个 { int i, max; max=num[0]; for(i=1;i<n;i++) if (num[i]>max) max=num[i]; return max; } void countSort(int num[], int n, ...
2018-12-28 14:59:37
82
原创 稀疏矩阵三元组乘法
#include #include <stdlib.h> using namespace std; #define MaxSize 100 int M,N; typedef struct { int r; int c; int d; //元素值 }TupNode; //三元组定义 typedef struct { int rows; int co...
2018-12-24 23:38:36
1016
原创 二叉树链式
include #include <stdlib.h> using namespace std; #define MaxSize 100 typedef struct node { char data; struct node *lchild,*rchild; }BTNode; void CreatBTBode(BTNode *&b,char *str) { BTNode *S...
2018-12-24 23:33:48
161
原创 顺序表解决荷兰国旗问题
- 顺序表解决荷兰国旗问题,设有一个条块序列,每个条块为红(0)、白(1)、兰(2)三种颜色的一种。假设该序列采用顺序表存储,设计一个时间复杂度为O(n)的算法,使得这些条块按红、白、兰的顺序排好。 ![(https://img-blog.csdnimg.cn/20181219221207289.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5n...
2018-12-20 21:02:22
1140
原创 双向链表建立并输出
#include #include &lt;stdlib.h&gt; using namespace std; #define Maxsize 100 typedef struct DNode { int data; struct DNode *prior; struct DNode *next; }DLinkList; void CreatListF(DLinkList *&amp;L,int...
2018-12-20 21:02:10
495
原创 链表建立
#include #include&amp;amp;amp;amp;amp;amp;amp;amp;lt;stdlib.h&amp;amp;amp;amp;amp;amp;amp;amp;gt; using namespace std; typedef struct LNode { int data; struct LNode *next; }LinkList; void CreateListF(LinkList *&amp;amp;amp;
2018-12-20 21:02:01
113
原创 栈的概念
栈的特点,后进先出。也称为后进先出表。 栈的基本运算: InitStack(&amp;amp;s): DestroyStack(&amp;amp;s): StackEmpty(s): Push(&amp;amp;s,e): Pop(&amp;amp;s,&amp;amp;e): GetTop(s,&amp;amp;e): 与线性表的逻辑关系相同,栈可以采用顺序栈或者链栈。 #define M
2018-12-20 21:01:23
135
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人