Please help me in making my code correct i have print array in sorted by recursion
Hey @kailash_01
your approach to sort an array using recursion is wrong, because if 0th and 1st elements are sorted, doesn’t mean they’re in the right position,
for example 8, 9, 10, 3, 1
just dry run your code on this.
acc to your code you will not change position of 8 and 9, your logic is wrong, basically to sort an array using recursion, you can use recursive bubble sort, try writing the code for that