基礎的話
試試看這題:
一個link的struct,
依target將struct其中的一個val,
做由高到低排序(QSort)。
target:
0 -> x
1 -> y
2 -> z
Constrain: The target is singed int of 32-bits-cpu (ILP32)
/* C lang */
struct s {
int y;
int x;
int z;
struct s* next;
}
void SortByTargetVal (struct s* input, int target) {
// your code
}
留言