Recurrence relation not clear

f(i)=min { f(2i), f(i+1), f(i-1)}

this is not how Dp works
for dp[i] it should be depend on previous calculated values not on future values which we have not solved

so we have modified the relation
correct one
if i is even
dp[i]= min(dp[i/2]+x,dp[i-1]+y} ;

if i is odd
dp[i]=min(dp[i-1]+y,dp[i+1/2]+x+z} ;

you can watch the video again it will definitely help

Sir I didn’t understand why not dp[i+1] will reult to maximum value so not added in even case as done in odd case

this is an observation
if it doesn’t happen you can’t solve it using dp

to get more feel of this
you take 2 -3 examples and try to make dp array manually
you will understand question in better manner and also observe this

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.