数据结构与算法(C语言版)
荷泽泽
菜鸡一枚
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
贪心策略相关
#include<iostream> #include <cmath> using namespace std; #include <vector> #include<algorithm> vector<int> pos; /* 找寻最大的最小距离:采用二分法。当 */ bool jud(int n, int c, int distance) { int current = pos[0]; //将第一头牛放在第一个房间 int n原创 2022-03-14 15:18:21 · 196 阅读 · 0 评论 -
数据结构
文章目录树的存储结构双亲表示法孩子表示法 树的存储结构 双亲表示法 #include <stdio.h> #define max_tree_size 100 typedef struct { int data ; }TElemtype; typedef struct PTNode { //node structure TElemtype data; //data fields int paren原创 2021-01-09 17:21:48 · 113 阅读 · 0 评论 -
顺序栈---算法
#include <stdio.h> #include <stdlib.h> #define stackintitsize 100 #define stackincrenment 10 typedef struct { int a; }SElemType; typedef struct { SElemType *base; SElemType *top; int stacksize; }Sqstack; Sqstack* InitStack(v原创 2020-11-19 18:59:05 · 230 阅读 · 0 评论 -
单链表---算法
#include <stdio.h> #include <stdlib.h> #define OK 1 #define ERROR 0 typedef struct { int a; //数据域 } Elemtype; typedef struct Lnode { Elemtype data; //数据域 struct Lnode *next; //指针域 }Lnode, *Linklist; int InitList (Link原创 2020-11-17 19:49:38 · 147 阅读 · 0 评论 -
线性表---算法
#include <stdio.h> #include <math.h> #include <stdlib.h> #define maxsize 100 #define init_size 10 typedef struct { int a; float b; } elemType; typedef struct { elemType *elem; int length; int listsize; }SqList; in原创 2020-11-14 22:27:10 · 171 阅读 · 0 评论 -
线性表的顺序表示
动态分布的一维数组,运用结构体和指针。 #include <stdio.h> #include <math.h> #include <stdlib.h> typedef struct { int a; float b; } array; typedef struct { array *elem; int length; }SqList; int main (void) { SqList L; int i=0; L.elem=(array *)ma原创 2020-11-11 21:22:57 · 132 阅读 · 0 评论
分享