Sorting numbers Solution

$35.00 $29.00

Problem Description Please sort a given sequence of positive integers in the ascending order. You should implement the randomized quicksort by yourself. For example, do not use the qsort function in the standard C library. Input Format The first line is the number of the remaining lines. Each of the next lines contains exactly one…

5/5 – (3 votes)

You’ll get a: zip file solution

 

Description

5/5 – (3 votes)

Problem Description

Please sort a given sequence of positive integers in the ascending order. You should implement the randomized quicksort by yourself. For example, do not use the qsort function in the standard C library.

Input Format

The first line is the number of the remaining lines. Each of the next lines contains exactly one positive integer.

Output Format

Please output in the ascending order all the positive integers from the second to the last lines of the input. Each positive integer should be in a separate line.

Technical Specification

  • 1 ≤ ≤ 100000.

  • The positive integers to be sorted are less than or equal to 100000.

Example

Sample Input:

Sample Output:

5

4

4

4

6

6

20

7

7

20

4

Sorting numbers Solution
$35.00 $29.00