void fun2(int Array[], int len)
{
int i = 0;
int temp = 0;
while (i<len)
{
temp++;
if (i==0||Array[i-1] < Array[i])
{
i += temp;
temp = 0;
}
else
{
int tempdata = Array[i];
Array[i] = Array[i - 1];
Array[i - 1] = tempdata;
i--;
}
}
}一个循环排序
最新推荐文章于 2022-11-29 22:38:45 发布
本文介绍了一种基于数组的排序算法实现细节。通过一种特殊的比较和交换机制,该算法能够有效地对数组元素进行排序。文章详细解释了算法的工作原理,包括如何通过循环和条件判断来优化排序过程。
18万+

被折叠的 条评论
为什么被折叠?



