0
Sorting elements
if I want to sort those elements except the first number I entered like this -4 5 7 -13 -1 ---> -4 -13 -1 5 7 what should I change is that have something to do with a [0]š https://code.sololearn.com/c4r8z7vSOBYh/?ref=app
5 Answers
+ 3
Then start sorting from 1
+ 1
Is this question solved, then ?
If not, change the start of your sorting loop to start with i=1 not i=0:
for (i=1; i<(n-1); i++)
{
for (j=i+1; j<n; j++)
{
+ 1
Then skip in 2s
for (i=1; i<(n-1); i+=2) {
"swap a[i], a[i+1] "
}
0
yes I tried that 5 m ago after a lot of disasters but thank you
0
yes solved but now a new prob I need to keep the first in his place and change the the others with their neighbours š