My sort!

Code:

// POINT_BUBSORT.CPP
// Bubble sort function. Sorts an array of ints in descending order.
// Copyright Dylan Horkin 2002
//template<class element>
void pointerBubbleSort(int *array, int n)
{
int *pointer = array;
int i, j, flag = 1;
int temp;
for(i = 1; (i <= n) && flag; i++)
{
flag = 0;
for(j = 0; j < (n - i); j++)
{
if (pointer[j + 1] < pointer[j])
{
temp = pointer[j + 1];
pointer[j + 1] = pointer[j];
pointer[j] = temp;
flag = 1;
}
}
if (i%1000 == 0)
cout << i << endl;
}
}

And theirs:

Code:

// BUBSORT.CPP
// Bubble sort function. Sorts an array of ints in descending order.
template<class element>
void bubbleSort(apvector <element> &array, int n)
{
int i, j, flag = 1;
int temp;
for(i = 1; (i <= n) && flag; i++)
{
flag = 0;
for(j = 0; j < (n - i); j++)
{
if (array[j + 1] > array[j])
{
temp = array[j + 1];
array[j + 1] = array[j];
array[j] = temp;
flag = 1;
}
}
if (i%100 == 0)
cout << i << endl;
}
}