- 博客(14)
- 资源 (8)
- 收藏
- 关注
原创 静态二分查找
二分查找//StaticBinarySearch.c#include #include #include #define SIZE 20void print_array(int a[],int len){ int i = 0; for(i=0;i<len;i++) { printf("%d,",a[i]); } printf("\n");}void ar
2016-04-20 10:32:01 286
原创 查找--静态查找与动态查找
静态查找:1.查询某个特定的数据元素是否在查找表中;2.检索某个特定的数据元素的各种属性。动态查找:1.在查找表中插入一个元素;2.从查找表中删去某个数据元素。(需要借助于顺序表)//SeqList.h#ifndef _SEQLIST_H_#define _SEQLIST_H_typedef void SeqList;typedef void
2016-04-19 17:06:49 3051
原创 图的最短路径-Dijkstra和Floyd
//Dijkstra.c#include #include /*--------------------------------------------------*time:2016-04-17*description: find the shortest path from the Vertex of sv to the Vertex of 4*-----------------
2016-04-19 14:33:14 291
原创 图的--最小-连通-网
#include #include /*------------------*time:2016-04-16*------------------*/#define VNUM 5#define MV 65536int P[VNUM]; //P[i]:the begin of Vertex,i: the end of Vertex int Cost[VNUM];
2016-04-16 22:02:24 394
原创 图的深度优先遍历和广度优先遍历--邻接矩阵法
//LinkQueue.h#ifndef _LINKQUEUE_H_#define _LINKQUEUE_H_typedef void LinkQueue;LinkQueue* LinkQueue_Create();void LinkQueue_Destroy(LinkQueue* queue);void LinkQueue_Clear(LinkQueue* queue);
2016-04-15 10:46:27 2397
原创 图的深度遍历和广度遍历--邻接链表法
//LinkList.h#ifndef _LINKLIST_H_#define _LINKLIST_H_typedef void LinkList;typedef struct _tag_LinkListNode LinkListNode;struct _tag_LinkListNode{ LinkListNode* next;};LinkList* LinkList_
2016-04-15 09:52:54 1256
原创 图--邻接矩阵法和邻接链表法的比较
邻接矩阵法由于没有相连的边也占有空间,因此存在浪费空间的问题,而临街链表法合理利用存储空间;邻接链表法比较耗时,牺牲很大的时间来查找,因此比较耗时,而邻接矩阵法相比邻接链表法来说,时间复杂度低;总结,邻接矩阵法:用时间换空间;邻接链表法:用空间换时间。
2016-04-14 15:03:31 2206 1
原创 图--邻接链表法
//LinkList.h#ifndef _LINKLIST_H_#define _LINKLIST_H_typedef void LinkList;typedef struct _tag_LinkListNode LinkListNode;struct _tag_LinkListNode{ LinkListNode* next;};LinkList* LinkList_
2016-04-14 14:55:38 834
原创 图--邻接矩阵法
//MGraph.h#ifndef _MGRAPH_H_#define _MGRAPH_H_typedef void MGraph;typedef void MVertex;typedef void (MGraph_Printf)(MVertex*);MGraph* MGraph_Create(MVertex** v,int n);void MGraph_Destroy(MG
2016-04-13 09:42:08 524
原创 线索化二叉树--单链表实现
//SeqList.h#ifndef _SEQLIST_H_#define _SEQLIST_H_typedef void SeqList;typedef void SeqListNode;SeqList* SeqList_Create(int capacity);void SeqList_Destroy(SeqList* list);void SeqList_Clear(
2016-04-08 16:03:42 336
原创 线索化二叉树--节点空指针实现过程
方法1:通过节点空指针来实现;//BTree.h#ifndef _BTREE_H_#define _BTREE_H_#define BT_LEFT 0#define BT_RIGHT 1typedef unsigned long long BTPos; //64bit typedef void BTree;typedef struct _tag_BTreeNode
2016-04-08 16:01:18 793
原创 指针和二级指针的区别
如:int a = 10;int* pt = &a;指针是对普通变量的操作;等同与:int* a = 10;int** pt = &a;二级指针是对指针的操作。void test(){ int a = 10; int* pt = &a; int** ppt = &pt; cout << "a = " << a << endl;
2016-04-08 09:45:39 319
转载 二叉树--前序遍历、中序遍历、后序遍历、层次遍历
//BTree.h#ifndef _BTREE_H_#define _BTREE_H_#define BT_LEFT 0#define BT_RIGHT 1typedef unsigned long long BTPos; //64bit typedef void BTree;typedef struct _tag_BTreeNode BTreeNode; /
2016-04-07 16:23:44 319
转载 二叉树--兄弟孩子表示法
//BTree.h#ifndef _BTREE_H_#define _BTREE_H_#define BT_LEFT 0#define BT_RIGHT 1typedef void BTree;typedef unsigned long long BTPos;typedef struct _tag_BTreeNode BTreeNode;struct _tag_BTreeN
2016-04-06 10:12:00 5364
the java programming language fourth editionArnoldGoslingHolmes06
2014-08-30
ascii-码表
2014-08-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人