7-12 sort

Source: Internet
Author: User

7-12 sort (25 points)

Given n integers (in the range of long integers), the result of the output from small to large is required.

This two parts is used to test the performance of a variety of different sorting algorithms in various data situations. The test data of each group are characterized as follows:

  • Data 1: only 1 elements;
  • Data 2:11 A different integer, test the basic correctness;
  • Data 3:103 random integers;
  • 4:104 random integers of data;
  • 5:105 random integers of data;
  • Data 6:105 sequential integers;
  • Data 7:105 inverse integers;
  • Data 8:105 basic ordered integers;
  • Data 9:105 random positive integers, not exceeding 1000 per digit. Input format:

    Enter the first line to give a positive integerN (≤10? ) 5?? ), followed by a line that gives an integer of n (in the range of long integers), separated by a space.

    Output format:

    Output from small to large in a row, the numbers are separated by 1 spaces, and there is no extra space at the end of the line.

    Input Sample:
    114 981 10 -17 0 -20 29 50 8 43 -5
    Sample output:
    -20 -17 -5 0 4 8 10 29 43 50 981
Ideas:?? Wait.

7-12 sort

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.