+ 1
Why this sort function not working?
7 Respostas
+ 2
Its still not working
+ 1
In line 45 the line break is '\n', not '/n.'
+ 1
Why is this printing 0 and not sort array
+ 1
Your code is not repeating to check all elements. There is some logic mismatching in for loop.. So can explain what is shell sort?? In btw i wil check code ones....
edit:
Piyush Srivastava
in the for loop initialize k as k = j - gap not k=gap - j ;
remove swap function declaration..
edit:
ok. got it. You need just a few changes...
Check this out... is this what you required code.. ?
https://code.sololearn.com/cOVJ0jfQmzc9/?ref=app
0
Swap definition? or missing some header?
I am not sure but look into it.
0
Piyush Srivastava
Swap function declaration mis matching, int should be like
void swap( int x , int y);
And actually it doesnot affect original value. So remove function write directly in else part..
if didnt work reply...
0
now its working..
Check this out... is this what you required code.. ?
https://code.sololearn.com/cOVJ0jfQmzc9/?ref=app