Recent questions tagged dynamic-programming

0 0 votes
0 0 answers
525
525 views
Match List I with List IIList IList IIA. The running time of straight forward recursive method to compute nth Fibonacci number $\text{Fn}$I. $O (n \left.{ }^{2}\right)$B....
0 0 votes
0 0 answers
778
778 views
Consider the following statements, which of the statement(s) is/are FALSE?The running time of dynamic programming algorithm is always θ (p) where p is number of subproble...
1 1 vote
1 1 answer
806
806 views
Consider a board game in consist of m × n grid. A coin is located at the top-left corner of an m × n grid. The coin can only move either down or right at any point in tim...
1 1 vote
2 2 answers
1.1k
1.1k views
How is the max possible value of n is 12? We will have to store T(0) and T(1) in stack too, so we can call f(11) at max which will require T(10) and T(9) and then we will...
0 0 votes
1 1 answer
1.6k
1.6k views
int max(int a, int b) { return (a b) ? a : b; }// Returns the maximum value that can be// put in a knapsack of capacity Wint knapSack(int W, int wt[], int val[], int n){...
0 0 votes
0 0 answers
557
557 views
Please list out the best free available video playlist for Algorithm design techniques: Dynamic programming from Algorithm as an answer here (only one playlist per answer...
11 11 votes
3 3 answers
1.2k
1.2k views
Consider the following recurrence relation which is applicable on two arrays $x$ and $y.\; x_i$ and $y_i$ are the $i^{\text{th}}$ elements of $x$ and $y$ array respective...
23 23 votes
3 3 answers
1.5k
1.5k views
You are working on a dynamic programming problem defined by the recurrence:\[ A(i, j) = F\!\big( A(\lfloor i/2 \rfloor,\, j),\; A(i,\, \lfloor j/2 \rfloor) \big), \]where...
15 15 votes
3 3 answers
994
994 views
In bottom-up dynamic programming, we need an order to fill in the solution cells in a table, such that all needed subproblems are solved before solving a subproblem. For ...
11 11 votes
4 4 answers
1.4k
1.4k views
Let $X=x_{1} x_{2} \cdots x_{m}$ and $Y=y_{1} y_{2} \cdots y_{n}$ be two strings over the alphabet $\displaystyle{}\Sigma= \{\mathrm{A}, \mathrm{C}, \mathrm{G}, \mathrm{T...
5 5 votes
1 1 answer
443
443 views
Which of the following is/are Longest Common Subsequence for given two sequecnces $\langle 1,0,0,1,0,1,0,1\rangle$ and $\langle 0,1,0,1,1,0,1,1,0\rangle$. $\{1,0,0,1,1,0\...
8 8 votes
2 answers 2 answers
680
680 views
Consider two teams, $\text{A}$ and $\text{B}$, playing a series of games until one of the teams wins $n$ games. Assume that the probability of $\text{A}$ winning a game i...
7 7 votes
1 1 answer
890
890 views
Consider the following $0-1$ knapsack problem with the item's weight and value given in the table.$$\begin{array}{c|cc} \text{item} & \text{weight} & \text{value} \\\hlin...
8 8 votes
4 4 answers
957
957 views
For a given sequence of integers $a_1, a_2, \ldots, a_n,$ a decreasing subsequence is one for which every integer is strictly smaller than the previous one.The longest de...
4 4 votes
1 1 answer
757
757 views
The number of longest common subsequences for "$bacb$" and "$abcabc$" are -$2$$3$$4$$5$