+ 1
How to code Sorting the index
Eg: {1,2,3,6,7,5,4,8} o/p : The array sorting from 3 to 6\\index value
2 Answers
+ 2
Sort array by comparisons of values of array
0
There are varies way to sorting..
For this case, quick sort will be better..
Choose 6 as, pivot and add all <6 to left, >6 to right.. Then
1,2,3,4, 5 6 7,8 now it is in sorted order,..
Simple way is bubble sort but time consuming..
https://www.sololearn.com/learn/774/?ref=app
Indexes are already in sorted order..