
算法
文章平均质量分 59
walterby
这个作者很懒,什么都没留下…
展开
-
Mergesort
1 /* 2 mergesort 3 */ 4 5 #include 6 #include 7 /* Lpos = start of left half, Rpos = start of right half */ 8 //void Merge(ElementType A[]. Ele原创 2013-05-20 18:06:41 · 386 阅读 · 0 评论 -
插入排序
1 /* 2 insertion sort 3 */ 4 5 #include 6 7 void InsertionSort(int A[], int N) 8 { 9 int j, p; 10 //ElementType Tmp; 11 int原创 2013-05-16 14:55:04 · 403 阅读 · 0 评论 -
八皇后
python/C原创 2013-08-21 16:21:12 · 480 阅读 · 0 评论 -
quicksort
1 /* quicksort */ 2 #include 3 4 #define Cutoff (3) 5 6 InsertionSort(int A[], int n) 7 { 8 int tmp, i, j; 9 10 for(i = 1; i < n; i++原创 2013-05-21 17:34:31 · 415 阅读 · 0 评论 -
希尔排序
1 /* 2 Shellsort route using Shell's increments 3 4 */ 5 6 7 #include 8 9 void Shellsort(int A[], unsigned int N) 10 { 11 in原创 2013-05-17 14:09:21 · 446 阅读 · 0 评论 -
Heapsort
1 /* 2 heapsort 3 */ 4 5 #include 6 #define LeftChild(i)(2 * (i) + 1) 7 8 //void PercDown(ElementType A[], int i, int N) 9 void PercDown(int A[],原创 2013-05-20 10:24:04 · 522 阅读 · 0 评论 -
欧几里得扩展算法
1 #include 2 int gcd(int a, int b) 3 { 4 if (b == 0) 5 return a; 6 return gcd(b, a % b); 7 } 8 9 int main(void) 10 { 11 int原创 2013-05-15 15:43:03 · 470 阅读 · 0 评论