In a array of n element first k(<=n)element is sorted ascending and remain n-k sorted in descending | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

In a array of n element first k(<=n)element is sorted ascending and remain n-k sorted in descending

make sure program should be efficent

10th Sep 2017, 4:59 PM
ram sahu
ram sahu - avatar
1 Réponse
0
You can not do better than n*log(n). There are lot of sorting algorithm meeting this condition (e.g. bubble sort)
24th Sep 2017, 9:15 AM
benettnash