Why this is not working
Selection sort is not working
hello @Spartan_online
your code is code.
a) just remove extra cout statement (statments that is not asked to print in output format).
b) you array size is very small. check making value that n can take and declare an array size bigger than that.
Code is still not working. I don’t know why because I followed everything taught in the video of selection sort. Help me fix this code.
Code is still not working. Help me fix this code.
@Spartan_online
a)

here replace a[i] with a[mid_index]
b)
declare ur array after reading n
something like

Why? I have already assigned min_index = i;
Look once again sir.
So, a[i] is same as a[min_index].
And what difference a[n] makes?
@Spartan_online
yeah i=min_index in starting but when ur code will update min_index then i will not be equal to min_index .
if are having any issue in understanding the alogrithm then pls watch the video again.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Yeah! I didn’t think about that… Thank you for ur help…