#include #include using namespace std; struct pointT{ int x, y; }; const int MAX_SIZE = 11; void FixArray(pointT array[], int size); void RandomArray(pointT array[], int size, int xRange, int yRange, int seed); void PrintPoint(pointT p); void PrintArray(pointT points[], int size); void SortArray(pointT points[], int size); int main() { pointT array1[] = {0,3,10,10,0,6,10,5,2,3,5,5,10,3,0,5,8,4,3,3,5,7}; pointT array2[MAX_SIZE]; FixArray(array1, MAX_SIZE); RandomArray(array2, MAX_SIZE,10,9, time(NULL)); FixArray(array2, MAX_SIZE); return 0; } void RandomArray(pointT array[], int size, int xRange, int yRange, int seed){ int i; srand(seed); for (i=0;i b.x) { returnValue = true; } else if ((a.x == b.x) && (a.y > b.y)){ returnValue = true; } return returnValue; } void Swap(pointT & a, pointT & b) { pointT tmp; tmp = a; a = b; b = tmp; return; } void SortArray(pointT points[], int size){ int i, j; int smallPos; for(i=0; i < size-1; i++) { smallPos = i; for(j=i+1;j