码迷,mamicode.com
首页 > 编程语言 > 详细

排序算法 - 快速排序

时间:2017-11-08 23:31:54      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:tar   []   int start   分治   int end   end   static   void   sys   

排序算法是对冒泡排序的改进,基于分治(divide and conquer)思想。

package com.anderson.sort;

public class QuickSort{

    public static void main(String []args){

       int[] a = {10,23,5,16,15,1,30,45,23,9};
       int start = 0;
       int end = a.length-1;
       sort(a,start,end);
       for(int i = 0; i<a.length; i++){
            System.out.println(a[i]);
        }
       
    }
}

  

排序算法 - 快速排序

标签:tar   []   int start   分治   int end   end   static   void   sys   

原文地址:http://www.cnblogs.com/cuiyijing/p/7806779.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!