![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Yoyo0916
这个作者很懒,什么都没留下…
展开
-
singly linked lists-Data Structures Using C
#include<stdio.h>#include<malloc.h>typedef struct node;typedef struct linked_list;void push_back(linked_list* list,int newdata);void push_front(linked_list* list,int newdata);原创 2019-03-09 10:09:01 · 354 阅读 · 0 评论 -
stacks-Data Structures Using C
#include<stdio.h>#include<malloc.h>typedef struct node;void push(node* head,int newdata);void pop(node* head);int top(node* head);int is_empty(node* head); typedef struct node{ ...原创 2019-03-09 10:16:58 · 327 阅读 · 0 评论 -
queues-Data Structures Using C
#include<stdio.h>#include<malloc.h>typedef struct node;typedef struct Queue;void init(Queue* queue);void push(Queue* queue,int newdata);void pop(Queue* queue);int is_empty(Queue* qu...原创 2019-03-09 11:37:52 · 340 阅读 · 0 评论 -
map
定义一个map容器 map<string,int>str;//使用string,必要时加#include<string>插入一个元素 str[in]=233; str.insert(pair<string,int>(in,233)); str.insert(make_pair((string)in),(int)233);//必要时加#includ...原创 2019-05-11 11:22:10 · 165 阅读 · 0 评论 -
kruskal
#define max 100edge es[max];int V,E;struct edge{int u,v,cost};int par[max];bool cmp(edge a,edge b){return a.cost<b.cost;}void init(int l){for(int i=0;i<l;i++)par[i];}int find(int x)...原创 2019-05-24 23:26:50 · 186 阅读 · 0 评论 -
segTree
#include<stido.h>#define max(a,b) a>b?a:b#define min(a,b) a<b?a:b#define INF 0x7fffffff#define size 100int arr[size];struct SegTreeNode{ int max; int min; int sum; int addMark;/...原创 2019-05-24 23:30:34 · 312 阅读 · 0 评论 -
new module
templatebool s_empty(T* S){return !S[0];}templateint s_size(T* S){return S[0];}templatevoid s_push(T* S,T newdata){S[int(++S[0])]=newdata;}templatevoid s_pop(T* S){S[0]–;}templateT s_top(T* S...原创 2019-07-16 02:01:22 · 436 阅读 · 0 评论