Bhaiya aapka logic nhi aaya samajh usme function call krte time +1 kyu kr rhe hai?
I have written logic for this ques. Is this correct and please tell me how your code is running?
Code link :- https://ide.codingblocks.com/s/660084
Bhaiya aapka logic nhi aaya samajh usme function call krte time +1 kyu kr rhe hai?
I have written logic for this ques. Is this correct and please tell me how your code is running?
Code link :- https://ide.codingblocks.com/s/660084
Hey @shivangsharma2000 We have added 1 while returning bcoz we are doing 1 step in the current function frame I can be n/2 or n-1 but we are doing a single step for every function frame that’s why we have added 1. And your and bhaiya’s logic is same but for the fact you have incremented c++ separately but bhaiya has done it while returning
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.