void teest(int *prm1, int prm2)
{
int m, n, tmp, flg;
for(m=prm2-1; m>0; --m)
{
flg = 0;
n=0;
while(n<m)
{
if ( prm1[n] > prm1[n+1])
{
tmp = prm1[n];
prm1[n] = prm1[n+1];
prm1[n+1]= tmp;
flg=1;
}
++n;
}
if (!flg)
break;
}
}
as you can see there is already the optimization of the flag ..
Do you think that there is sth else that could make that algorithm (Bubble sort) better and faster? is there another better optimization?