An array with 65,535 numbers that do not duplicate integers greater than 0 (that is, all the non-repeating integers in the 0~~65535, the order is disorganized), sorted in the quickest way

Source: Internet
Author: User

Note: If you think about this problem, it's a big mistake to compare elements.

Of course, this algorithm is not optimal, it does not represent universality. But can be extended, the overall or this idea, is nothing more than "fill in the blanks" operation

 Public classOrderlink {/*** An array of 65,535 numbers that do not duplicate integers greater than 0 (that is, all the non-repeating integers in the 0~~65535, the order is disorganized), * the fastest way to sort * @param args*/     Public Static voidMain (string[] args) {//For example, an array with 65,535 numbers that do not repeat an integer greater than 0        int[] Prel =New int[]{2,4,9,5,3,6,7,8, One,1, A,0,Ten}; int[] Endl =Oderbysel (Prel);  for(intI:endl) {System. out. print (i +"<"); }    }        //Sorting Methods    Private Static int[] Oderbysel (int[]inch){        int[] Inl =New int[inch. length];  for(intI=0;i<inch. length;i++) {inl[(int)inch[i]] =inch[i]; }        returnINL; }}

An array with 65,535 numbers that do not duplicate integers greater than 0 (that is, all the non-repeating integers in the 0~~65535, the order is disorganized), sorted in the quickest way

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.