Company: BNY round 2 mcq_21march
Difficulty: medium
What is the Time complexity of the following recurrence relation of longest common subsequence in dynamic programming? C(i,j)={ 0 if i=0,j=0 C(i-1)(j-1)+1 if i,j>0 & Xi=Yi Max (C(i,j-1),C(i-1,j)) if i,j>0 & Xi != Yi } O(2^n) O(n^2) O(n^3) O(3^n) A list contains the prices of two products to be sold on a website for the next 4 days. The constraints to sell the product are as follows: 1. Only one product can be sold on the given day. 2. The second product can be sold only if no product is sold on the previous day. The data is as follows: Day 1: A=60, B=90; Day 2: A=30, B=40; Day 3: A=30, B=40; Day 4: A=70, B=110. Select the correct output to get the maximum profit using recursion in top down manner. 1. Sell B on first day 2. Sell A on second day 3. Sell none on third day 4. Sell B on fourth day 1. Sell A on first day 2. Sell A on second day 3. Sell none on third day 4. Sell B on fourth day 1. Sell B on first day 2. Sell B on second day 3. Sell none on third day 4. Sell A on