retagged by
592 views
1 votes
1 votes
let $S$ be a String containing either $0$ or $1$ .further there are no two consecutive $0s$ in $S$. No of solution on an input size $S(N)$ is bounded by

$O(n^2)$

$O(nlogn)$

$O(2^n)$

$O(n)$
retagged by

1 Answer

4 votes
4 votes
Recurrence for following is

S(n)=S(n-1)+S(n-2) where S(0)=1 and S(1)=2

Above recurrence is nothing but Fibonacci series which is upper bounded by O($2^{n}$) thus C

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
3
NeelParekh asked Jul 27, 2023
275 views
If an array is split in the form of increasing and decreasing order then what is TC to find minimum element in the array?
2 votes
2 votes
1 answer
4
h4kr asked Dec 30, 2022
462 views
What is the correct time complexity in $\theta()$ ?