????????????
???????????? ???????[ 2014/3/18 15:05:35 ] ???????????? ????
?????????λ???д????????????????????????????????????????????£?????????????λ?????????????????????????????????????????????£????????2???????????????????????????
????????????????????????????????????????????????????????????????????????и?????????????????????????????????????λ?ò??????????????????o??n????o??1????
????????????????????????????????????????????????????ε??????????????????????????С???????С?????臨?????O??n2????????ж???????????臨?????O??n?????
?????磺-3??1??2??-1??-3??4?????????????????????????????-1???嵽???????????1??????棬?????????????????1??2???????λ???????????臨??????O??n?????????????O??1????
//???????????
void Sort??int *A ??int size??
{
int minus=-1??plus=-1;
int tmp=0;
for??int i=0;i<size;i++??
{
if??minus==-1??
{
if??A[i]<0 && plus>=0??
{
minus=i;
}
if??A[i]>0 && plus<0??
{
plus=i;
}
}
if??minus>=0 && plus>=0??
{
tmp=A[plus];
A[plus++] = A[minus];
for ??int k = minus; k> plus; k--??
{
A[k] = A[k - 1];
}
A[plus]=tmp;
minus=-1;
}
}
}
??????????????????????????????????????飬????????????????????????????????????????????????????????????λ?ò??????????????????o??n????o??1????
???????????????????????????????????????????????
//??????????
void Sort1??int *A ??int size??
{
int minus=-1??plus=-1;
int tmp=0;
for??int i=0;i<size;i++??
{
if??minus==-1??
{
if??A[i]??2!=0 && plus>=0??
{
minus=i;
}
if??A[i]??2==0 && plus<0??
{
plus=i;
}
}
if??minus>=0 && plus>=0??
{
tmp=A[plus];
A[plus++] = A[minus];
for ??int k = minus; k> plus; k--??
{
A[k] = A[k - 1];
}
A[plus]=tmp;
minus=-1;
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11