最低排序值 [英] lowest value of sort

查看:88
本文介绍了最低排序值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到排序的最低值?
我有一个整数数组,我需要按低->高排序.
我需要知道交换数字值的最低计数,即:

我有7469-> 4697-最小值为7,因为4 + 6 + 9更大.

7123将为6,因为1 + 2 + 3< 7.

什么是算法?

How to find a lowest value of sort?
I have an array of integers and I need to sort it low->high.
I need to know the lowest count of swapped number values, i.e :

I have 7469 -> 4697 - Lowest value is 7, as 4+6+9 is more.

7123 would be 6, as 1+2+3 < 7.

What is the algorithm?

推荐答案

看起来像您想要的气泡排序 [ ^ ]
looks like you want the Bubble Sort[^]


这篇关于最低排序值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆