13 lines
291 B
C
13 lines
291 B
C
typedef struct Map{
|
|
int key;
|
|
int value;
|
|
};
|
|
|
|
int compare_decending(const void *a, const void *b){
|
|
return (*(struct Map *)b).value - (*(struct Map *)a).value;
|
|
}
|
|
int compare_ascending(const void *a, const void *b){
|
|
return (*(struct Map *)a).value - (*(struct Map *)b).value;
|
|
}
|
|
|