摘要: 1。插入排序插入排序#include <stdio.h>#define LEN 5int a[LEN] = {10, 5, 2, 4, 7};void insertion_sort(void){ int i, j, key; for (j=1; j<LEN; j++) { printf("%d,%d,%d,%d,%d\n", a[0], a[1], a[2], a[3], a[4]); key = a[j]; i = j - 1; /* move, find the location */ while (i>=0 && a[i]> 阅读全文
posted @ 2012-09-29 16:29 神之一招 阅读(216) 评论(0) 推荐(0)