需要新建一个list ,存入后后面的值进行降序。。这种东西怎么写。。我只会简单的冒泡。。
https~==id-ifeng-com=user=login 10000
https~==id-ifeng-com=user=login 20000
http~==2016-sina-com-cn= 10000
http~==2016-sina-com-cn= 20000
http~==2016-sina-com-cn= 27300
http~==2016-sina-com-cn= 34600
http~==health-ifeng-com= 6900
http~==health-ifeng-com= 13800
java的话,直接用list的sort方法,内部使用快速排序实现。
http://blog.163.com/ygm0104@126/blog/static/16976748820153213258476/
直接用api是最快最好的,Java提供的
Arrays. sort就是Java提供的排序工具类,直接传入一个实现排序接口的对象数组即可。就是将排序操作交给Java的这个函数,只要告诉它对象间该怎么比较即comparable接口。