Submission #19230

# Submission time Handle Problem Language Result Execution time Memory
19230 2016-02-21T13:06:31 Z middleageddr 짝수 정렬 (tutorial3) C++
Compilation error
0 ms 0 KB
#include "grader.h"

void q_sort(int left, int right, int *A) {
	int i, j, pivot;
	int temp;

	i = pivot = left;
	j = right;

	if (i < j) {

		while (i < j) {
			while ((i < j) && (*(A + i) < *(A + pivot))) i++;
			while ((i < j) && (*(A + j) >= *(A + pivot))) j--;

			if (i < j) {
				temp = *(A + i);
				*(A + i) = *(A + j);
				*(A + j) = temp;
			}
		}

		temp = *(A + pivot);
		*(A + pivot) = *(A + j);
		*(A + j) = temp;
		
		q_sort(left, j - 1, A);
		q_sort(j + 1, right, A);
	}


}

Compilation message

/tmp/ccBQtwtb.o: In function `main':
grader.cpp:(.text.startup+0xa7): undefined reference to `sort_even(int, int*)'
collect2: error: ld returned 1 exit status