Java Sorting Algorithm _ 014 quick sorting (quicksort)

Source: Internet
Author: User
Package WZS. Sort; // quicksort is an improvement in Bubble sorting. Proposed by C. A. R. Hoare in 1962. // Its basic idea is to split the data to be sorted into two separate parts by one sort. All the data in one part is smaller than that in the other part, // then sort the two data parts by using this method. The entire sorting process can be recursive to convert the entire data into an ordered sequence. Public class test {public static void main (string [] ARGs) {int [] A = {10, 3, 5, 7, 9, 1, 4, 2, 6, 8}; quick (a); For (INT I = 0; I <. length; I ++) system. out. print (A [I] + "");} public static void quick (INT [] A2) {If (a2.length> 0) {// check whether the array is empty _ quicksort (A2, 0, a2.length-1);} public static void _ quicksort (INT [] list, int low, int high) {If (low 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.