随笔分类 -  数据结构实例

摘要:1.#include <stdio.h>#include <stdlib.h>#include "Hash.h"/* 哈希技术的实现 */struct Student{ char* id; char* name; int age;};int compare_id(HashKey* k1, HashK 阅读全文
posted @ 2016-12-19 13:19 王小波私人定制 阅读(1436) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "BSTree.h"/* 二叉树排序算法 */struct Node{ BSTreeNode header; char v;};void printf_data(BSTreeNode* node){ if 阅读全文
posted @ 2016-12-19 13:00 王小波私人定制 阅读(871) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>#include <time.h>#define SIZE 20//打印数组void println(int array[], int len){ int i = 0; for(i=0; i<len; i++) { print 阅读全文
posted @ 2016-12-15 18:05 王小波私人定制 阅读(761) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>#include <time.h>#include "SeqList.h" //调用库函数#define SIZE 20/* 打印数组 */void print_array(int a[], int len){ int i = 阅读全文
posted @ 2016-12-15 17:37 王小波私人定制 阅读(268) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>/* Floyd算法 */#define VNUM 5#define MV 65536int P[VNUM][VNUM];int A[VNUM][VNUM];int Matrix[VNUM][VNUM] ={ {0, 10, 阅读全文
posted @ 2016-12-14 12:16 王小波私人定制 阅读(240) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>/* Dijkstra算法 */#define VNUM 5#define MV 65536int P[VNUM]; //保存最短路径int Dist[VNUM];int Mark[VNUM];int Matrix[VNUM] 阅读全文
posted @ 2016-12-14 10:03 王小波私人定制 阅读(677) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>/* 最小路径算法 --》prim算法 */#define VNUM 9#define MV 65536int P[VNUM];int Cost[VNUM];int Mark[VNUM]; //标记数组int Matrix[V 阅读全文
posted @ 2016-12-14 09:35 王小波私人定制 阅读(390) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "LGraph.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-12 11:52 王小波私人定制 阅读(350) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "MGraph.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-12 11:37 王小波私人定制 阅读(551) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "Graph.h"/* 图的定义 */int main(int argc, char *argv[]){ Graph* graph = Graph_Create(5); Graph_AddEdge(gra 阅读全文
posted @ 2016-12-12 11:00 王小波私人定制 阅读(172) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "BTree.h"#include "SeqList.h"/* 线索二叉树 */struct Node{ BTreeNode header; char v;};void printf_data(BTree 阅读全文
posted @ 2016-12-10 16:48 王小波私人定制 阅读(426) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "BTree.h"#include "LinkQueue.h"/* 主方法 */struct Node{ BTreeNode header; char v;};void printf_data(BTree 阅读全文
posted @ 2016-12-10 16:19 王小波私人定制 阅读(711) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "BTree.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-10 16:03 王小波私人定制 阅读(385) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include "GTree.h"/* 主方法 测试 */void printf_data(GTreeData* data){ printf("%c", (int)data);}int main(int argc, char *argv[]){ //创建一棵 阅读全文
posted @ 2016-12-10 15:47 王小波私人定制 阅读(716) 评论(0) 推荐(0) 编辑
摘要:1. #ifndef _TREE_H_#define _TREE_H_ typedef void Tree;typedef void TreeNode; /* 创建树 */Tree* Tree_Create(); /* 销毁已存在的树 */void Tree_Destroy(Tree* tree); 阅读全文
posted @ 2016-12-10 15:15 王小波私人定制 阅读(137) 评论(0) 推荐(0) 编辑
摘要:1.希尔算法: #include <stdio.h>/* 希尔排序算法实现--但有时不稳定 */void println(int array[], int len){ int i = 0; for(i=0; i<len; i++) { printf("%d ", array[i]); } print 阅读全文
posted @ 2016-12-09 12:02 王小波私人定制 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1.冒泡: #include <stdio.h>/* 冒泡排序算法实现 */void println(int array[], int len){ int i = 0; for(i=0; i<len; i++) { printf("%d ", array[i]); } printf("\n");}v 阅读全文
posted @ 2016-12-09 11:12 王小波私人定制 阅读(253) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>/* 实现多关键字排序 */typedef struct _tag_DataElem{ char desc[20]; int key1; int key2;} DataElem;int compare1(DataElem* ld, DataElem* rd){ 阅读全文
posted @ 2016-12-09 10:51 王小波私人定制 阅读(244) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "SQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-08 14:51 王小波私人定制 阅读(324) 评论(0) 推荐(0) 编辑
摘要:1.#include <stdio.h>#include <stdlib.h>#include "LinkQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or in 阅读全文
posted @ 2016-12-08 14:42 王小波私人定制 阅读(255) 评论(0) 推荐(0) 编辑

DON'T FORGET TO HAVE FUN
点击右上角即可分享
微信分享提示