quick sort predefined function in c 2b 2b

Solutions on MaxInterview for quick sort predefined function in c 2b 2b by the best coders in the world

showing results for - "quick sort predefined function in c 2b 2b"
Domenico
16 Feb 2016
1#include <cstdlib>
2
3//declare compare
4int compare(const void* a, const void* b)
5{
6	const int* x = (int*) a;
7	const int* y = (int*) b;
8
9	if (*x > *y)
10		return 1;
11	else if (*x < *y)
12		return -1;
13
14	return 0;
15}
16
17//fuction used
18qsort(arr,num,sizeof(int),compare);
19