两个List,第二个List根据第一个List排序

/// <summary>
/// 协同排序
/// </summary>
/// <param name="sod"></param>
/// <param name="dis"></param>
/// <returns></returns>
private List<int> oids(List<int> sod, List<double> dis)
{ for (int tmpi = ; tmpi < dis.Count; tmpi++)
{
//找到最小的id
int lid = tmpi;
for (int tmpj = tmpi + ; tmpj < dis.Count; tmpj++)
{
if (dis[lid] > dis[tmpj])
{
lid = tmpj;
}
}
//互换最小的与当前
double ti = dis[lid];
int tname = sod[lid];
dis[lid] = dis[tmpi];
dis[tmpi] = ti;
sod[lid] = sod[tmpi];
sod[tmpi] = tname;
} return sod;
}
上一篇:Nginx下WordPress的Rewrite


下一篇:Oracle ORA-12541:TNS:no listener错误解决方法 (转)