-->
当前位置:首页 > 题库

PROGRAMMING:sort

Luz5年前 (2021-05-10)题库380
Given $$n $(in the range of long integers), it is required to output the sorted results from small to large.
The purpose of this paper is to test the performance of different sorting algorithms in various data situations. The characteristics of each group are as follows
  • Data 1: only one element;
  • Data 2: 11 different integers, testing the basic correctness;
  • Data 3: 10 < sup > 3 < / sup > random integers;
  • Data 4: 10 < sup > 4 < / sup > random integers;
  • Data 5: 10 < sup > 5 < / sup > random integers;
  • Data 6: 10 < sup > 5 < / sup > sequential integers;
  • Data 7: 10 < sup > 5 < / sup > reverse integers;
  • Data 8: 10 < sup > 5 < / sup > basically ordered integers;
  • Data 9: 10 < sup > 5 < / sup > Random positive integers, each number does not exceed 1000.
    ###Input format:
    Enter the first line to give the positive integer $$n $$($$Le 10 ^ 5 $$), and the next line to give $$n $$integers (in the range of long integers), separated by spaces.
    ###Output format:
    Output the sorted results from small to large in a row, the numbers are separated by a space, and there must be no extra space at the end of the row.
    ###Input example:
    ```in
    eleven
    4 981 10 -17 0 -20 29 50 8 43 -5
    ```
    ###Output example:
    ```out
    -20 -17 -5 0 4 8 10 29 43 50 981
    ```






    answer:If there is no answer, please comment