Selection Sort

easy
1.You are given an array of size 'N'.
 2.You have to complete the function selectionSort() that should sort the value of the array.

Input Format

First line contains an Integer 'N' denoting the size of the array. Second line contains 'N' space separated elements of the array.

Output Format

Output will be the resultant array.

Constraints

1 <=N<= 1000
 1 <=arr[i]<= 1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
5
4 1 3 9 7
Output
1 3 4 7 9
Previous
Merge Two Sorted Arrays
Next
Merge Sort

Related Questions