admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Sort an array containing 1 to N.

suraz Ghimire
5 Posts

Given an array that contains all the numbers from 1 to N in any random order, sort the array possibly without replacing any number

Note: No numbers are missing in this array

Eg:

Input : arr[] = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1};
Output : 1 2 3 4 5 6 7 8 9 10 

 

Published By : suraz Ghimire
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin