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