Recurrence relation over geeksforgeeks is given as
for (int i = 1; i < n; i++)
{
a[i] = a[i-1] + b[i-1];
b[i] = a[i-1];
}
Can anyone explain me how?
Recurrence relation over geeksforgeeks is given as
for (int i = 1; i < n; i++)
{
a[i] = a[i-1] + b[i-1];
b[i] = a[i-1];
}
Can anyone explain me how?
Let a[i] be the number of binary strings of length i which end in 0.
let b[i] be the number of such strings which end in 1.
a[i] = a[i - 1] + b[i - 1]
If you want a simpler relation, you can refer to the video itself. Is the explanation clear?
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.