--> O(NlogN)
step1
step2
step3
int compare(const void* a, const void* b) { int *p1 = (int *) a; int *p2 = (int *) b; if (*p1 == *p2) return 0; if (*p1 < *p2) return -1; if (*p1 > *p2) return 1; }