edited by
1,061 views
1 votes
1 votes

At the end of it's 5th Successful season,The siruseri Permier league is planning to give an award to most improved bowler over 5 years . For this an important Index will be computed for each bowler,This is defined as the longest Subsequence of strictly decreasing economy rate's by the bowler among all his matches over 5 season's.For example seasons are (10.0,5.0,8.9,6.7,4.2,5.5,2.2,3.4,6.0,2.3,2.0) so his improvement index is 7 based on sequence (10.0 ,8.9, 6.7, 5.5, 3.4, 2.3, 2.0)  

Now let E[1...........N] Donates a sequence of n economy rates for which improvement index is to be calculated 
for 1 $\leq$ j $\leq$ n,Let I[j] denotes the improved index for the prefix of score E[1.......j ] ending at E[j] 

 

  1. Which of the following is correct recursive formulation of I(j) ?
    a) I(1)=1
    for j $\in$ 2,3,......,n I(j) = 1+ max {I(k)/ 1$\leq$K<j, E[k] > E[j]}

    b) I(1)=1
    for j $\in$2,3,......,n I(j) = 1+E(j-1) if E(j-1)<E(j)
    1 otherwise 

    C) I(1)=1
    for j $\in$2,3,......,n I(j) = 1+ max {I(k)/ 1$\leq$K<j, E[k] < E[j]}

    d)I(1)=1
    for j $\in$2,3,......,n I(j) = 1+E(j-1) if E(j-1) > E(j)
    1 otherwise 
  2. How to evaluate this Recursive definition Using Dynamic programming?
    a) A 2-D table T of Size N X N to be filled row wise from T[1][1] to T[n][n]

    b) A 1-D table T of Size N  to be filled from T[n] to T[1] 

    C) A 2-D table T of Size N X N to be filled row wise from T[n][n] to T[1][1]

    d) A 1-D table T of Size N  to be filled from T[n] to T[1] 
  3. What is the Time complexity in Dynamic programming ? 
    a) O(n)
    b) O(nLog n)
    c) O(n2)
    d) O(n3)
edited by

1 Answer

Best answer
2 votes
2 votes

1. Answer is a. Reading the problem statement 4-5 times gives this :)

The current considered element must be smaller than ALL previous entries. So, b, c, and d are false. 

2. 1-D table filled from T[1] to T[n]

3. O(n)

selected by

Related questions

0 votes
0 votes
0 answers
2
rexritz asked Aug 13, 2023
301 views
$T\left ( n \right )= 8T\left ( \frac{n}{2} \right )+\left ( n\cdot logn \right )^{2.99}$Also can $\mathcal{O}(n^{3})$ be an upper bound to above recurrence relation?
0 votes
0 votes
1 answer
3
LavTheRawkstar asked Feb 1, 2017
719 views
T(n)= 4T(n//64) + n/log n How to apply Akra Bazi methodHere using akra bazi method p will be 1/3after that how to integrate please tell somebody ?
0 votes
0 votes
0 answers
4