if i iterates from 0 to 1 then j should iterartes from 1 to n-1 and while calling function in main why we wrote a instead of a[ ]
Problem during iteration of i and j
why i is iterating from i=0 to <n-1;
while sending an array we just pass the name of the array and not not the corresponding paranthesis ( thats like a default syntax )
its like u are sending int num in the function then u just mention num and not num
yess
we are basically iterating to the second last value
because the inner j loop is checking for values beyond i
there willl be no problem even if u write
i =0 ; i < n ; i++
im basically asking about j will iterates from where to where
because in 11th line j iterates from i which mean it starts from 0 not from 1 ?
in 17th line of code we didn’t wrote swap(a[j],a[min_index]); because we finding the minimun element in another subarray in which j is iterating
j will iterate from [i to n-1]
bhaiya is writing swap
please read this
all ur doubts will be solved
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.