随笔分类 -  数据结构与算法

深度优先遍历图(DFS)
摘要:#include <stdlib.h> #include <stdio.h> #define MAX_NUM 10 //最多可存储的顶点数 const int NUL = -1; const int FALSE = -1; const int TRUE = 0; int visited[MAX_NU 阅读全文

posted @ 2018-05-23 23:16 MrRS 阅读(240) 评论(0) 推荐(0)

实现具有getMin功能的栈
摘要:#include "stack.h" #include #include Stack SMin, SData; int PUSH(int *_d) { int temp = 0; PushStack(&SData, _d); if(EmptyStack(&SMin) == 0) PushStack(&SMin, _d); else ... 阅读全文

posted @ 2018-05-18 17:23 MrRS 阅读(112) 评论(0) 推荐(0)

用两个栈来模拟一个队列
摘要:#include "stack.h" #include #include int EnQueue(Stack *_push, int *_d) { if(FullStack(_push) == 0) return -1; PushStack(_push, _d); } int DeQueue(Stack *_push, Stack *_pop, int ... 阅读全文

posted @ 2018-05-18 15:29 MrRS 阅读(227) 评论(0) 推荐(0)

线索二叉树实例(前序创建,中序遍历)--2018.5.15
摘要:1 #include 2 #include 3 4 typedef enum 5 { 6 Link, 7 Tread 8 }PointerTag; 9 10 typedef char TElemType; 11 12 typedef struct TreeNode 13 { 14 TElemType data; /... 阅读全文

posted @ 2018-05-15 20:43 MrRS 阅读(1375) 评论(0) 推荐(0)

堆栈应用:匹配文本符号({ }、[ ]、())----2018.5.13
摘要:#include #include #include #include typedef char Status; //函数返回结果 typedef struct _member { char ch; int line; int column; }Data; typedef struct _stack { int size; int memb;... 阅读全文

posted @ 2018-05-13 15:00 MrRS 阅读(462) 评论(0) 推荐(0)

链表应用:输出目录下所有文件(夹)(Ubuntu16.04)
摘要:#include #include #include #include #include typedef struct linklist { char *name; struct linklist *next; }linknode, *linklistp; linklistp insert_local(linklistp head, const l... 阅读全文

posted @ 2018-05-10 10:04 MrRS 阅读(487) 评论(0) 推荐(0)

导航