Linear search recursive?

please check my approach

@mehulbhandari358 these are the mistakes:

  1. For first occurence, start from 0
  2. check condition in line 6 should be if(a[i]==k)
  3. Base condition will be if(i==n)

i think you are wrong . it gave me correct answers.
i am reducing the array by (n-1),
and initially i have done i=0, so where is the problem>

can you check it again ?

@mehulbhandari358 I saw it again, your code is fine, as you are incrementing pointer to array and reducing n.
It seems to be working fine, are you still facing any problem?

please also chech my prata spoj code .
i have uploaded it on the discuss panel ?

@mehulbhandari358 that doubt will be answered there itself if you have asked it using ask doubt section.

yes i have done like that . but there is no relpy ? please check it if you can ?

@mehulbhandari358 please ask this in the whatsapp group about doubt being not replied since we as TA answer those queries which we acknowledge.

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.