Processing math: 100%

Partial Sort solved by 609

Feb. 21, 2014, 5:36 p.m. by Rosalind Team

Topics: Sorting

Problem

Given: A positive integer n105 and an array A[1..n] of integers from 105 to 105, a positive integer k1000.

Return: The k smallest elements of a sorted array A.

Sample Dataset

10
4 -6 7 8 -9 100 12 13 56 17
3

Sample Output

-9 -6 4

Please login to solve this problem.