比较简洁易懂的写法,没申请新的空间。 int cmp(const void *a, const void *b) { return (((struct Interval*)a)->start - ((struct Interval*)b)->start); } struct Interval* merge(struct Interval* intervals, int intervalsLen, int* returnSize ) { int i, k = 1, returnLen = intervalsLen; qsort(intervals, int...