template<class T>void swap(T* x, int i, int j) { T tmp; tmp = x[i]; x[i] = x[j]; x[j] = tmp;} template<class T>void BubbleSort(T* x) { for (int i = 0; i < n; i++) { for (int j = n-1; j > i; j-- ) { if (x[j-1] > x[j]) { swap(x, j-1, j); } } }}