Alright, with various possibly conflicting things being said people have probably confused you, and you're over thinking things. This is about what you need I believe:
Code:
template <class iterator>
int sortPercentage(iterator start, iterator finish)
{
int outOfOrder = 0;
int numPairs = ...; // Simple subtraction equation here
for (...)
{
if (... > ...)
{
outOfOrder++;
}
}
return 100 * outOfOrder / numPairs;
}
Other than the ... bits, I've left one other little math problem with it for you to correct. See what values you get from that for an already sorted and a reverse sorted array.