![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 81
scorpio_3
这个作者很懒,什么都没留下…
展开
-
按List中对像某属性排序算法1---实现Comparator接口
按List中Person类的age属性进行排序。 Person类: package com.flg; /** * Created with IntelliJ IDEA. * User: fuliguo * Date: 12-7-29 * Time: 下午12:35 * To change this template use File | Settings | F...原创 2012-07-29 15:06:17 · 122 阅读 · 0 评论 -
按List中对像某属性排序算法2---实现Comparable接口
按List中Person类的age属性进行排序。 Person类: package com.flg; /** * Created with IntelliJ IDEA. * User: fuliguo * Date: 12-7-29 * Time: 下午13:09 * To change this template use File | Settings | F...原创 2012-07-29 17:39:58 · 97 阅读 · 0 评论 -
JAVA数据结构与算法---JAVA冒泡排序
按List中Person类的age属性进行排序。 Person类: package com.flg; /** * Created with IntelliJ IDEA. * User: fuliguo * Date: 12-7-29 * Time: 下午13:09 * To change this tem...2012-07-29 23:37:39 · 71 阅读 · 0 评论 -
JAVA数据结构与算法---JAVA简单选择排序
按List中Person类的age属性进行排序。 Person类: package com.flg; /** * Created with IntelliJ IDEA. * User: fuliguo * Date: 12-7-29 * Time: 下午13:09 * To change this t...2012-07-30 00:01:38 · 63 阅读 · 0 评论 -
JAVA设计模式---策略模式
对Object数组中的Person对象,按某属性进行排序。具体的按某属性排序被抽象出来,形成策略。 Person类: package com.flg.Strategy; import java.util.Comparator; /** * Created with IntelliJ IDEA. * User: fuliguo * Date: 12-8-12 *...原创 2012-08-12 18:28:21 · 94 阅读 · 0 评论 -
JAVA设计模式---简单工厂模式
在上一篇策略模式的基础上进一步优化,引出简单工厂模式。 按Object数组中Person的某一属性进行排序,按哪个属性排序的功能抽象为接口,具体由对应策略实现类完成。 这一篇主要是把调用相应策略时改为工厂模式调用,来演示工厂模式的使用。 Person类: package com.flg.Strategy; import java.util.Comparator; /** ...原创 2012-08-13 02:05:09 · 97 阅读 · 0 评论