您的位置:首页 > 其它

选择排序_排序算法_算法

2013-06-13 00:26 225 查看
选择排序:

public static void Sort(int []array)
{
int temp = 0;
int t = 0;
for(int i=0;i<array.Length-1;i++)
{
temp = array[i];
t = i;
for (int j = i; j < array.Length;j++ )
{
if (temp > array[j])
{
temp = array[j];
t = j;
}
}
if (t != i)
{
array[t] = array[i];
array[i] = temp;
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐