Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java¸÷ÖÖÅÅÐò·½·¨

package org.rut.util.algorithm.support;
 
import org.rut.util.algorithm.SortUtil;
/**
 * @author treeroot
 * @since 2006-2-2
 * @version 1.0
 */
public class InsertSort implements SortUtil.Sort{
 
    /* (non-Javadoc)
     * @see org.rut.util.algorithm.SortUtil.Sort#sort(int[])
     */
    public void sort(int[] data) {
        int temp;
        for(int i=1;i<data.length;i++){
            for(int j=i;(j>0)&#38;&#38;(data[j]<data[j-1]);j--){
                SortUtil.swap(data,j,j-1);
            }
        }       
    }
 
}
ðÅÝÅÅÐò:
package org.rut.util.algorithm.support;
 
import org.rut.util.algorithm.SortUtil;
 
/**
 * @author treeroot
 * @since 2006-2-2
 * @version 1.0
 */
public class BubbleSort implements SortUtil.Sort{
 
    /* (non-Javadoc)
     * @see org.rut.util.algorithm.SortUtil.Sort#sort(int[])
     */
    public void sort(int[] data) {
        int temp;
        for(int i=0;i<data.length;i++){
            for(int j=data.length-1;j>i;j--){
                if(data[j]<data[j-1]){
                    SortUtil.swap(data,j,j-1);
     &


Ïà¹ØÎĵµ£º

eclipseÖн«javaÏîĿתΪwebÏîÄ¿


1.ÐÞ¸ÄÏîÄ¿µÄ.projectÎļþ£¬±£´æ£¬Ë¢Ð¹¤³Ì¡£
    ÔÚ<natures>
         …
      </natures>
   Ö®¼äÌí¼ÓÏÂÁÐÈýÐÐÅäÖÃ
<nature>org.eclipse.wst.common.project.facet.core.nature</n ......

java ½øÖÆ×ª»»

public class Test { 
      public static void main(String args[]) {  
        System.out.println(Integer.toBinaryString(20));   //Ê®½øÖÆ-->2½øÖÆ  
        System ......

javaÉè¼ÆÄ£Ê½Ðò

³ÌÐòÉè¼ÆÊǽâ¾öÎÊÌâ˼·µÄ¾ßÌ廯.¾ÍÏñ½¨ÔìÒ»×ù·¿×ÓÒ»Ñù£¬ÓÃʲôÑùµÄ²ÄÁÏ,½¨Ôìʲô·ç¸ñµÄ½¨Öþ,¾ßÌåÿ¸öλÖÃÊÇʲô... ²»Í¬µÄ½¨Öþʦ»áÓв»Í¬µÄ·½·¨. ¶ø°ÑÍê³ÉÄ³Ò»ÌØ¶¨ÎÊÌâµÄ½â¾ö˼·¹æ·¶Ò»Ï ¾Í¿ÉÒÔ³Æ×÷ΪһÖÖÉè¼ÆÄ£Ê½.
³ÌÐòÉè¼ÆÖÐÉè¼ÆÄ£Ê½ÎªÎÒÃÇÔÚijһÎÊÌâÓòÌṩÁËÒ»ÖÖÁ¼ºÃµÄʵÏÖ·½·¨²Î¿¼£¬¿ÉÒÔ´ó´óʵÏÖ¸´Óú͸ßЧ¡£
ÏÂÃæÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ