Application 1
Given a vector of integers. Sort the values in the vector in ascending order.Input file: sort.in
Line 1: n - the number of elements in the array
Line 2: A1 - The element number1 from the array [...]
Line n+1: An - The element number n from the array
Output file: sort.out
Line 1: S1 ... Sn, where S is the array A sorted in ascending order
Restrictions
-30000<=A1, ..., An<=30000
-1<=n<=30000
Organize the vector as a heap and extract the minimum value one by one. In this way, the total complexity will be [n log n] independent of the structure of the input data.