通用归并排序
摘要:
再来写写通用归并排序。 代码如下:#include <stdio.h>#include <stdlib.h>#include <string.h>static void merge(void* arr, int(*cmp)(void*, void*), int left, int mid, int right, int size){ char* tmpArr = (char*)malloc((right - left + 1) * size); int i = left, j = mid + 1, k = 0; while (i <= mid & 阅读全文
posted @ 2012-01-14 10:13 弗远 阅读(140) 评论(0) 推荐(0) 编辑