Can someone explain this sort algorithm to me and how i can make a more efficient version, justifying the changes.
for (int p = 0; p<n-1; p++)
for (int counter = 0;counter < n-1; counter++)
if (a[counter]> a[counter+1])
swap(a, counter, counter+1);
Apreciate all help.