• 数组冒泡排序


    import org.omg.Messaging.SyncScopeHelper;
    
    public class 冒泡排序 {
    
        public static void main(String[] args) { 
            
            int []array=new int[]{63,4,24,1,3,13};
            System.out.println("冒泡排序法的过程是:");
            for(int i=1;i<array.length;i++)
            {
                for(int j=0;j<array.length-i;j++)
                {
                    if(array[j]>array[j+1])
                    {
                        int temp=array[j];
                        array[j]=array[j+1];
                        array[j+1]=temp;
                    }
                    System.out.print(array[j]+" ");
                }
                System.out.print("【");
                for(int j=array.length-i;j<array.length;j++)
                {
                    System.out.print(array[j]+" ");
                }
                System.out.println("】");
            }
        }
    }
    答案
    冒泡排序法的过程是:
    4 24 1 3 13 【634 1 3 13 【24 631 3 4 【13 24 631 3 【4 13 24 631 【3 4 13 24 63 】
  • 相关阅读:
    Rx
    linux rpm 安装包制作
    kamctl start
    dedicated bearer
    Kamailio
    EPC sequence
    TD-LTE技术原理与系统设计
    SS7
    SCTP
    GTP
  • 原文地址:https://www.cnblogs.com/panyiquan/p/5225996.html
Copyright © 2020-2023  润新知