Post date: Nov 30, 2016 4:02:40 AM
/-오름 차순 정렬 *-
<< Insert sort >>
for( i = 1 ; i < nCnt ; i++ )
{
temp = ptrBuf[i];
j = i - 1;
while( j > -1 && ptrBuf[j] > temp )
{
ptrBuf[j+1] = ptrBuf[j];
j--;
}
ptrBuf[j+1] = temp;
}
<< bubble Sort >>
for (i = ( log_cnt - 1 ) ; i > 0; --i)
{
for (j = 0; j < i; ++j)
{
if ( ptrbuf[j] > ptrbuf[j + 1] )
{
tmp = ptrbuf[j];
ptrbuf[j] = ptrbuf[j + 1];
ptrbuf[j + 1] = tmp;
}
}
}