547 views
0 votes
0 votes

Let A(n) denotes the number of n bit binary string which have no pair of consecutive 1’s. Then the time complexity of the effective algorithm which uses dynamic programming to compute A(n) will be ____

  1. O(n)
  2. O(2^n)
  3. O(n^3)
  4. O(nlogn) 

Here, the answer given is O(n);

I didn’t get this even after going through the solution. If any one can understand the bellow solution help me  get it , THANK YOU :)

Please log in or register to answer this question.

Related questions

2 votes
2 votes
0 answers
1
Nandkishor3939 asked Jan 13, 2019
659 views
Can any one explain whats happening in side the green area due to dynamic programming ?