﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Qiegds-文章分类-File</title><link>http://www.blogjava.net/Qiegds/category/44934.html</link><description>Q之世界</description><language>zh-cn</language><lastBuildDate>Sun, 06 Jun 2010 13:30:52 GMT</lastBuildDate><pubDate>Sun, 06 Jun 2010 13:30:52 GMT</pubDate><ttl>60</ttl><item><title>Java中的排序汇总</title><link>http://www.blogjava.net/Qiegds/articles/322413.html</link><dc:creator>Q奇Q</dc:creator><author>Q奇Q</author><pubDate>Tue, 01 Jun 2010 02:11:00 GMT</pubDate><guid>http://www.blogjava.net/Qiegds/articles/322413.html</guid><wfw:comment>http://www.blogjava.net/Qiegds/comments/322413.html</wfw:comment><comments>http://www.blogjava.net/Qiegds/articles/322413.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Qiegds/comments/commentRss/322413.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Qiegds/services/trackbacks/322413.html</trackback:ping><description><![CDATA[<div id="threadtitle">&nbsp;</div>
<div class="t_msgfontfix">
<table cellspacing="0" cellpadding="0">
    <tbody>
        <tr>
            <td class="t_msgfont" id="postmessage_769674">JAVA排序汇总 收藏 <br />
            package com.softeem.jbs.lesson4;<br />
            import java.util.Random;<br />
            /**<br />
            * 排序测试类<br />
            * <br />
            * 排序算法的分类如下：<br />
            * 1.插入排序（直接插入排序、折半插入排序、希尔排序）；<br />
            * 2.交换排序（冒泡泡排序、快速排序）；<br />
            * 3.选择排序（直接选择排序、堆排序）；<br />
            * 4.归并排序；<br />
            * 5.基数排序。<br />
            * <br />
            * 关于排序方法的选择：<br />
            * (1)若n较小(如n&#8804;50)，可采用直接插入或直接选择排序。<br />
            * 　当记录规模较小时，直接插入排序较好；否则因为直接选择移动的记录数少于直接插人，应选直接选择排序为宜。<br />
            * (2)若文件初始状态基本有序(指正序)，则应选用直接插人、冒泡或随机的快速排序为宜；<br />
            * (3)若n较大，则应采用时间复杂度为O(nlgn)的排序方法：快速排序、堆排序或归并排序。<br />
            * <br />
            */<br />
            public class SortTest {<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 初始化测试数组的方法<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @return 一个初始化好的数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public int[] createArray() {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Random random = new Random();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int[] array = new int[10];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; 10; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;array<em> = random.nextInt(100) - random.nextInt(100);//生成两个随机数相减，保证生成的数中有负数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========原始序列==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printArray(array);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;return array;<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 打印数组中的元素到控制台<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param source<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void printArray(int[] data) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;for (int i : data) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;System.out.print(i + " ");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println();<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 交换数组中指定的两元素的位置<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param x<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param y<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; private void swap(int[] data, int x, int y) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int temp = data[x];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data[x] = data[y];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data[y] = temp;<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 冒泡排序----交换排序的一种<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 方法：相邻两元素进行比较，如有需要则进行交换，每完成一次循环就将最大元素排在最后（如从小到大排序），下一次循环是将其他的数进行类似操作。 <br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 性能：比较次数O(n^2),n^2/2；交换次数O(n^2),n^2/4<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* <br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data 要排序的数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param sortType 排序类型<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @return<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void bubbleSort(int[] data, String sortType) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (sortType.equals("asc")) { //正排序，从小排到大<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//比较的轮数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //将相邻两个数进行比较，较大的数往后冒泡<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 0; j &lt; data.length - i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &gt; data[j + 1]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//交换相邻两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;swap(data, j, j + 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else if (sortType.equals("desc")) { //倒排序，从大排到小<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//比较的轮数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //将相邻两个数进行比较，较大的数往后冒泡<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 0; j &lt; data.length - i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &lt; data[j + 1]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//交换相邻两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;swap(data, j, j + 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;System.out.println("您输入的排序类型错误！");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printArray(data);//输出冒泡排序后的数组值<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 直接选择排序法----选择排序的一种<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 方法：每一趟从待排序的数据元素中选出最小（或最大）的一个元素， 顺序放在已排好序的数列的最后，直到全部待排序的数据元素排完。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 性能：比较次数O(n^2),n^2/2<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*&nbsp; &nbsp;&nbsp; &nbsp; 交换次数O(n),n<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*&nbsp; &nbsp;&nbsp; &nbsp; 交换次数比冒泡排序少多了，由于交换所需CPU时间比比较所需的CUP时间多，所以选择排序比冒泡排序快。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*&nbsp; &nbsp;&nbsp; &nbsp; 但是N比较大时，比较所需的CPU时间占主要地位，所以这时的性能和冒泡排序差不太多，但毫无疑问肯定要快些。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* <br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data 要排序的数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param sortType 排序类型<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @return<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void selectSort(int[] data, String sortType) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (sortType.equals("asc")) { //正排序，从小排到大<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;int index;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; index = 0;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 1; j &lt;= data.length - i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &gt; data[index]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;index = j;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //交换在位置data.length-i和index(最大值)两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; swap(data, data.length - i, index);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else if (sortType.equals("desc")) { //倒排序，从大排到小<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;int index;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; index = 0;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 1; j &lt;= data.length - i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &lt; data[index]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;index = j;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //交换在位置data.length-i和index(最大值)两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; swap(data, data.length - i, index);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;System.out.println("您输入的排序类型错误！");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printArray(data);//输出直接选择排序后的数组值<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 插入排序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 方法：将一个记录插入到已排好序的有序表（有可能是空表）中,从而得到一个新的记录数增1的有序表。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 性能：比较次数O(n^2),n^2/4<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*&nbsp; &nbsp;&nbsp; &nbsp; 复制次数O(n),n^2/4<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*&nbsp; &nbsp;&nbsp; &nbsp; 比较次数是前两者的一般，而复制所需的CPU时间较交换少，所以性能上比冒泡排序提高一倍多，而比选择排序也要快。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data 要排序的数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param sortType 排序类型<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void insertSort(int[] data, String sortType) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (sortType.equals("asc")) { //正排序，从小排到大<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//比较的轮数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //保证前i+1个数排好序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 0; j &lt; i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &gt; data<em>) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//交换在位置j和i两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;swap(data, i, j);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else if (sortType.equals("desc")) { //倒排序，从大排到小<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//比较的轮数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for (int i = 1; i &lt; data.length; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; //保证前i+1个数排好序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (int j = 0; j &lt; i; j++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data[j] &lt; data<em>) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//交换在位置j和i两个数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;swap(data, i, j);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;System.out.println("您输入的排序类型错误！");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printArray(data);//输出插入排序后的数组值<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 反转数组的方法<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data 源数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void reverse(int[] data) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int length = data.length;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int temp = 0;//临时变量<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; length / 2; i++) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;temp = data<em>;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;data<em> = data[length - 1 - i];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;data[length - 1 - i] = temp;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printArray(data);//输出到转后数组的值<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 快速排序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 快速排序使用分治法（Divide and conquer）策略来把一个序列（list）分为两个子序列（sub-lists）。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 步骤为：<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 1. 从数列中挑出一个元素，称为 "基准"（pivot），<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 2. 重新排序数列，所有元素比基准值小的摆放在基准前面，所有元素比基准值大的摆在基准的后面（相同的数可以到任一边）。在这个分割之后，该基准是它的最后位置。这个称为分割（partition）操作。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 3. 递归地（recursive）把小于基准值元素的子数列和大于基准值元素的子数列排序。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 递回的最底部情形，是数列的大小是零或一，也就是永远都已经被排序好了。虽然一直递回下去，但是这个算法总会结束，因为在每次的迭代（iteration）中，它至少会把一个元素摆到它最后的位置去。<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data 待排序的数组<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param low<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param high<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @see SortTest#qsort(int[], int, int)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @see SortTest#qsort_desc(int[], int, int)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public void quickSort(int[] data, String sortType) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (sortType.equals("asc")) { //正排序，从小排到大<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_asc(data, 0, data.length - 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else if (sortType.equals("desc")) { //倒排序，从大排到小<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_desc(data, 0, data.length - 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;System.out.println("您输入的排序类型错误！");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 快速排序的具体实现，排正序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param low<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param high<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; private void qsort_asc(int data[], int low, int high) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int i, j, x;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (low &lt; high) { //这个条件用来结束递归<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;i = low;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;j = high;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;x = data<em>;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;while (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; while (i &lt; j &amp;&amp; data[j] &gt; x) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;j--; //从右向左找第一个小于x的数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data<em> = data[j];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;i++;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; while (i &lt; j &amp;&amp; data<em> &lt; x) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;i++; //从左向右找第一个大于x的数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data[j] = data<em>;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;j--;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;data<em> = x;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_asc(data, low, i - 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_asc(data, i + 1, high);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* 快速排序的具体实现，排倒序<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param data<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param low<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;* @param high<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; private void qsort_desc(int data[], int low, int high) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int i, j, x;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (low &lt; high) { //这个条件用来结束递归<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;i = low;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;j = high;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;x = data<em>;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;while (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; while (i &lt; j &amp;&amp; data[j] &lt; x) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;j--; //从右向左找第一个小于x的数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data<em> = data[j];<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;i++;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; while (i &lt; j &amp;&amp; data<em> &gt; x) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;i++; //从左向右找第一个大于x的数<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (i &lt; j) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;data[j] = data<em>;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;j--;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;data<em> = x;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_desc(data, low, i - 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;qsort_desc(data, i + 1, high);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*二分查找特定整数在整型数组中的位置(递归)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*查找线性表必须是有序列表<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@paramdataset]*@paramdataset[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@paramdata]*@paramdata[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@parambeginIndex]*@parambeginIndex[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@paramendIndex]*@paramendIndex[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@returnindex]*@returnindex[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public int binarySearch(int[] dataset, int data, int beginIndex,<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;int endIndex) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int midIndex = (beginIndex + endIndex) &gt;&gt;&gt; 1; //相当于mid = (low + high) / 2，但是效率会高些<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data &lt; dataset[beginIndex] || data &gt; dataset[endIndex]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; || beginIndex &gt; endIndex)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return -1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data &lt; dataset[midIndex]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return binarySearch(dataset, data, beginIndex, midIndex - 1);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else if (data &gt; dataset[midIndex]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return binarySearch(dataset, data, midIndex + 1, endIndex);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return midIndex;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; /**<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*二分查找特定整数在整型数组中的位置(非递归)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*查找线性表必须是有序列表<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@paramdataset]*@paramdataset[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@paramdata]*@paramdata[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;[email=*@returnindex]*@returnindex[/email]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;*/<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public int binarySearch(int[] dataset, int data) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int beginIndex = 0;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int endIndex = dataset.length - 1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int midIndex = -1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (data &lt; dataset[beginIndex] || data &gt; dataset[endIndex]<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; || beginIndex &gt; endIndex)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return -1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;while (beginIndex &lt;= endIndex) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;midIndex = (beginIndex + endIndex) &gt;&gt;&gt; 1; //相当于midIndex = (beginIndex + endIndex) / 2，但是效率会高些<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (data &lt; dataset[midIndex]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; endIndex = midIndex - 1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;} else if (data &gt; dataset[midIndex]) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; beginIndex = midIndex + 1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;} else {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return midIndex;<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;return -1;<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            &nbsp; &nbsp;&nbsp; &nbsp; public static void main(String[] args) {<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SortTest sortTest = new SortTest();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int[] array = sortTest.createArray();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========冒泡排序后(正序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.bubbleSort(array, "asc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========冒泡排序后(倒序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.bubbleSort(array, "desc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;array = sortTest.createArray();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========倒转数组后==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.reverse(array);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;array = sortTest.createArray();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========选择排序后(正序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.selectSort(array, "asc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========选择排序后(倒序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.selectSort(array, "desc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;array = sortTest.createArray();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========插入排序后(正序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.insertSort(array, "asc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========插入排序后(倒序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.insertSort(array, "desc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;array = sortTest.createArray();<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========快速排序后(正序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.quickSort(array, "asc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.printArray(array);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========快速排序后(倒序)==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.quickSort(array, "desc");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sortTest.printArray(array);<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("==========数组二分查找==========");<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;System.out.println("您要找的数在第" + sortTest.binarySearch(array, 74)<br />
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; + "个位子。（下标从0计算）");<br />
            &nbsp; &nbsp;&nbsp; &nbsp; }<br />
            }<br />
            <br />
            <em><em><em><em><em><em><em><em><em><em><em><em><em><em><em>转载地址：<a href="http://blog.csdn.net/lenotang/archive/2008/11/29/3411346.aspx" target="_blank">http://blog.csdn.net/lenotang/archive/2008/11/29/3411346.aspx</a><br />
            本文来自CSDN博客，转载请标明出处：<a href="http://blog.csdn.net/zuoluoboy/archive/2009/04/25/4123943.aspx" target="_blank">http://blog.csdn.net/zuoluoboy/archive/2009/04/25/4123943.aspx</a></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></em></td>
        </tr>
    </tbody>
</table>
</div>
<img src ="http://www.blogjava.net/Qiegds/aggbug/322413.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Qiegds/" target="_blank">Q奇Q</a> 2010-06-01 10:11 <a href="http://www.blogjava.net/Qiegds/articles/322413.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA三大框架的各自作用</title><link>http://www.blogjava.net/Qiegds/articles/321663.html</link><dc:creator>Q奇Q</dc:creator><author>Q奇Q</author><pubDate>Sun, 23 May 2010 08:21:00 GMT</pubDate><guid>http://www.blogjava.net/Qiegds/articles/321663.html</guid><wfw:comment>http://www.blogjava.net/Qiegds/comments/321663.html</wfw:comment><comments>http://www.blogjava.net/Qiegds/articles/321663.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Qiegds/comments/commentRss/321663.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Qiegds/services/trackbacks/321663.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;只有注册用户登录后才能阅读该文。<a href='http://www.blogjava.net/Qiegds/articles/321663.html'>阅读全文</a><img src ="http://www.blogjava.net/Qiegds/aggbug/321663.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Qiegds/" target="_blank">Q奇Q</a> 2010-05-23 16:21 <a href="http://www.blogjava.net/Qiegds/articles/321663.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VO DAO BO POJO PO 是什么(JAVA几种对象的解释)</title><link>http://www.blogjava.net/Qiegds/articles/320401.html</link><dc:creator>Q奇Q</dc:creator><author>Q奇Q</author><pubDate>Sun, 09 May 2010 06:36:00 GMT</pubDate><guid>http://www.blogjava.net/Qiegds/articles/320401.html</guid><wfw:comment>http://www.blogjava.net/Qiegds/comments/320401.html</wfw:comment><comments>http://www.blogjava.net/Qiegds/articles/320401.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Qiegds/comments/commentRss/320401.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Qiegds/services/trackbacks/320401.html</trackback:ping><description><![CDATA[<div class="Section0" style="layout-grid:  15.6pt none">
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">PO:persistant&nbsp;object<font face="宋体">持久对象</font><font face="Arial">,</font><font face="宋体">可以看成是与数据库中的表相映射的</font><font face="Arial">java</font><font face="宋体">对象。最简单的</font><font face="Arial">PO</font><font face="宋体">就是对应数据库中某个表中的一条记录，多个记录可以用</font><font face="Arial">PO</font><font face="宋体">的集合。</font><font face="Arial">PO</font><font face="宋体">中应该不包含任何对数据库的操作</font><font face="Arial">.&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">VO:value&nbsp;object<font face="宋体">值对象。通常用于业务层之间的数据传递，和</font><font face="Arial">PO</font><font face="宋体">一样也是仅仅包含数据而已。但应是抽象出的业务对象</font><font face="Arial">,</font><font face="宋体">可以和表对应</font><font face="Arial">,</font><font face="宋体">也可以不</font><font face="Arial">,</font><font face="宋体">这根据业务的需要</font><font face="Arial">.</font><font face="宋体">个人觉得同</font><font face="Arial">DTO(</font><font face="宋体">数据传输对象</font><font face="Arial">),</font><font face="宋体">在</font><font face="Arial">web</font><font face="宋体">上传递</font><font face="Arial">.&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">DAO:data&nbsp;access&nbsp;object<font face="宋体">数据访问对象，此对象用于访问数据库。通常和</font><font face="Arial">PO</font><font face="宋体">结合使用，</font><font face="Arial">DAO</font><font face="宋体">中包含了各种数据库的操作方法。通过它的方法</font><font face="Arial">,</font><font face="宋体">结合</font><font face="Arial">PO</font><font face="宋体">对数据库进行相关的操作</font><font face="Arial">.&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">BO:business&nbsp;object<font face="宋体">业务对象</font><font face="Arial">,</font><font face="宋体">封装业务逻辑的</font><font face="Arial">java</font><font face="宋体">对象</font><font face="Arial">,</font><font face="宋体">通过调用</font><font face="Arial">DAO</font><font face="宋体">方法</font><font face="Arial">,</font><font face="宋体">结合</font><font face="Arial">PO,VO</font><font face="宋体">进行业务操作</font><font face="Arial">;&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">POJO:plain&nbsp;ordinary&nbsp;java&nbsp;object&nbsp;<font face="宋体">简单无规则</font><font face="Arial">java</font><font face="宋体">对象</font><font face="Arial">,</font><font face="宋体">我个人觉得它和其他不是一个层面上的东西</font><font face="Arial">,VO</font><font face="宋体">和</font><font face="Arial">PO</font><font face="宋体">应该都属于它</font><font face="Arial">.&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">PO<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">persistant&nbsp;object<font face="宋体">持久对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">最形象的理解就是一个<font face="Arial">PO</font><font face="宋体">就是数据库中的一条记录。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">好处是可以把一条记录作为一个对象处理，可以方便的转为其它对象。&nbsp;</span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">BO<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">business&nbsp;object<font face="宋体">业务对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">主要作用是把业务逻辑封装为一个对象。这个对象可以包括一个或多个其它的对象。&nbsp;</span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">比如一个简历，有教育经历、工作经历、社会&nbsp;关系等等。&nbsp;</span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">我们可以把教育经历对应一个<font face="Arial">PO</font><font face="宋体">，工作经历对应一个</font><font face="Arial">PO</font><font face="宋体">，社会&nbsp;关系对应一个</font><font face="Arial">PO</font><font face="宋体">。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">建立一个对应简历的<font face="Arial">BO</font><font face="宋体">对象处理简历，每个</font><font face="Arial">BO</font><font face="宋体">包含这些</font><font face="Arial">PO</font><font face="宋体">。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">这样处理业务逻辑时，我们就可以针对<font face="Arial">BO</font><font face="宋体">去处理。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">VO&nbsp;<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">value&nbsp;object<font face="宋体">值对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">ViewObject<font face="宋体">表现层对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">主要对应界面显示的数据对象。对于一个<font face="Arial">WEB</font><font face="宋体">页面，或者</font><font face="Arial">SWT</font><font face="宋体">、</font><font face="Arial">SWING</font><font face="宋体">的一个界面，用一个</font><font face="Arial">VO</font><font face="宋体">对象对应整个界面的值。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">DTO&nbsp;<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">Data&nbsp;Transfer&nbsp;Object<font face="宋体">数据传输对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">主要用于远程调用等需要大量传输对象的地方。&nbsp;</span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">比如我们一张表有<font face="Arial">100</font><font face="宋体">个字段，那么对应的</font><font face="Arial">PO</font><font face="宋体">就有</font><font face="Arial">100</font><font face="宋体">个属性。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">但是我们界面上只要显示<font face="Arial">10</font><font face="宋体">个字段，&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">客户端用<font face="Arial">WEB&nbsp;service</font><font face="宋体">来获取数据，没有必要把整个</font><font face="Arial">PO</font><font face="宋体">对象传递到客户端，&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">这时我们就可以用只有这<font face="Arial">10</font><font face="宋体">个属性的</font><font face="Arial">DTO</font><font face="宋体">来传递结果到客户端，这样也不会暴露服务端表结构</font><font face="Arial">.</font><font face="宋体">到达客户端以后，如果用这个对象来对应界面显示，那此时它的身份就转为</font><font face="Arial">VO&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">POJO&nbsp;<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">plain&nbsp;ordinary&nbsp;java&nbsp;object&nbsp;<font face="宋体">简单</font><font face="Arial">java</font><font face="宋体">对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">个人感觉<font face="Arial">POJO</font><font face="宋体">是最常见最多变的对象，是一个中间对象，也是我们最常打交道的对象。&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">一个<font face="Arial">POJO</font><font face="宋体">持久化以后就是</font><font face="Arial">PO&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">直接用它传递、传递过程中就是<font face="Arial">DTO&nbsp;<br />
<br />
</p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">原文来自：野蔷薇&nbsp;&nbsp;<font face="Arial">http://www.yeqiangwei.com/club/f4b0l0fp1t342010p1.html&nbsp;</font></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><!--endfragment--></font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">直接用来对应表示层就是<font face="Arial">VO&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">DAO<font face="宋体">：&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">data&nbsp;access&nbsp;object<font face="宋体">数据访问对象&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">这个大家最熟悉，和上面几个<font face="Arial">O</font><font face="宋体">区别最大，基本没有互相转化的可能性和必要</font><font face="Arial">.&nbsp;</font></span><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: bold; font-size: 24pt; color: rgb(0,0,0); font-family: '宋体'; mso-spacerun: 'yes'">主要用来封装对数据库的访问。通过它可以把<font face="Arial">POJO</font><font face="宋体">持久化为</font><font face="Arial">PO</font><font face="宋体">，用</font><font face="Arial">PO</font><font face="宋体">组装出来</font><font face="Arial">VO</font><font face="宋体">、</font><font face="Arial">DTO</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
</div>
<!--endfragment-->
<img src ="http://www.blogjava.net/Qiegds/aggbug/320401.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Qiegds/" target="_blank">Q奇Q</a> 2010-05-09 14:36 <a href="http://www.blogjava.net/Qiegds/articles/320401.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>