Help needed in linear search using recursion

link

@ysurange1998 hey I have modified your code:https://ide.codingblocks.com/s/209420

1 Like

Thank you for your help. Can you also tell me what was the mistake in my code i.e logical error or any error ?

@ysurange1998 hi,apke base case me dikkt thi and recursion call me ek aur element ana tha ,also apne constant size ka array lia that is 4 kuch bhi ho skta hai size to,so use index of array in recursion that is left and right in our case and call recursion in l+1 and r-1 agr usme mil gya khi to woh true return krdega nhi to agar hmara l ya right pr hi hai searching element to wo true return krdega ,recursion ko aise hi assume kia kro always.Hope you get it.

1 Like

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.