摘要: 1 #include 2 #include 3 4 typedef int ElementType; 5 6 struct BinarySearchTreeNode 7 { 8 ElementType Element; 9 struct BinarySearchTreeNode *Left; 10 struct BinarySearchTreeN... 阅读全文
posted @ 2018-08-05 21:51 Asurudo 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 #define MaxSize 1000 5 #define MAX(a,b) ( (a) > (b) ? (a) : (b) ) 6 7 //set empty Treenode's height is 0,according to WIKIPEDIA 8 typedef int ElementT... 阅读全文
posted @ 2018-08-05 21:50 Asurudo 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 #define MAXINPUTNUM 5000 5 6 typedef int ElementType; 7 8 void BucketSort(ElementType *Array,int ArrayLen) 9 { 10 int i; 11 int ArrayEnd; 12 int Bu... 阅读全文
posted @ 2018-08-05 21:49 Asurudo 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 typedef int ElementType; 5 6 struct StackNode 7 { 8 ElementType Element; 9 struct StackNode *Next; 10 }; 11 12 int StackIsEmpty(struct Stac... 阅读全文
posted @ 2018-08-05 21:49 Asurudo 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 #define CUTOFF 3 4 5 typedef int ElementType; 6 7 void SwapTwoNum(ElementType *Num_1,ElementType *Num_2) 8 { 9 int NumTemp = *Num_1; 10 *Num_1 = *Num_2; ... 阅读全文
posted @ 2018-08-05 21:48 Asurudo 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 typedef int ElementType; 4 5 void InsertionSort(ElementType *Array,int ArrayLen) 6 { 7 int i,j; 8 ElementType ExtractElem; 9 for(i = 1;i = 0 && ExtractElem < Ar... 阅读全文
posted @ 2018-08-05 21:48 Asurudo 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 typedef int ElementType; 5 6 void _Merge(ElementType *Array,ElementType *TmpArray,int LeftStart,int RightStart,int RightEnd) 7 { 8 int i; 9 int ArrayLen... 阅读全文
posted @ 2018-08-05 21:47 Asurudo 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 5 struct Struction 6 { 7 double one; 8 int another; 9 }; 10 11 int CmpInt_1(const void *a,const void *b) 12 { 13 return *(int... 阅读全文
posted @ 2018-08-05 21:46 Asurudo 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 typedef int ElementType; 4 5 void SwapTwoNum(ElementType *Num_1,ElementType *Num_2) 6 { 7 int NumTemp = *Num_1; 8 *Num_1 = *Num_2; 9 *Num_2 = NumTemp; 10 } 11 ... 阅读全文
posted @ 2018-08-05 21:45 Asurudo 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <malloc.h> 3 4 #define LeftChild(i) (2*(i)+1) 5 6 typedef int ElementType; 7 8 void SwapTwoNum(ElementType *Num_1,Elem 阅读全文
posted @ 2018-08-05 21:42 Asurudo 阅读(129) 评论(0) 推荐(0) 编辑