2011年3月17日

InsertSort(插入排序)

摘要: 1 /* 2 * InsertSort.c 3 * 4 * Author: MagicYun 5 * 6 * 7 */ 8 9 #include <stdio.h>10 #include <stdlib.h>11 12 void Show(int *list, int n)13 {14 int i;15 for(i = 0; i < n; i++)16 {17 printf("%d ", *(list + i));18 }19 printf("\n");20 }21 22 void InsertSort(int *list, 阅读全文

posted @ 2011-03-17 19:45 MagicYun 阅读(221) 评论(0) 推荐(0)

ShellSort(希尔排序)

摘要: /** ShellSort.c** Author: MagicYun** O(n^1.5) key: f(n) = 3 * f(n - 1) + 1**/#include <stdio.h>#include <stdlib.h>void Show(int *list, int n) //show the list{ int i; for(i = 0; i < n; i++) { printf("%d ",*(list + i)); } printf("\n");}void ShellInsert(int *list, int 阅读全文

posted @ 2011-03-17 19:32 MagicYun 阅读(207) 评论(0) 推荐(0)

导航