i have done same thing with another approach by shifting largest element to last …
here is my program please see its valid or not
https://ide.codingblocks.com/s/188642
thanks in advance
i have done same thing with another approach by shifting largest element to last …
here is my program please see its valid or not
https://ide.codingblocks.com/s/188642
thanks in advance
i should start from 1.
rest is okay
sorry but i dont get it why i should start with 1 @abhinavsingh
if(a[j] > a[j+1])
and j goes till n-i, if i is zero than j goes till n, now j+1 will become out of bound.