edited by
1,141 views
2 votes
2 votes

edited by

1 Answer

Best answer
4 votes
4 votes
okay,it can be solved using Dynamic Programming

and once one is computed, it can be easily found by going through the table.

and we can write it like

T(12)=T(10)+T(9)

T(10)=T(8)+T(7)

T(9)=T(7)+T(6)

T(8)=T(6)+T(5)

T(7)=T(5)+T(4)

T(6)=T(4)+T(3)

T(5)=T(3)+T(2)

T(4)=T(2)+T(1)

T(3)=T(1)+T(0)

T(2)=T(0)+T(-1)

We need one function call for each unique T(x)

here we need function calls T(-1),T(0),T(1),T(2,)T(3),T(4),T(5),T(6),T(7),T(8),T(9),T(10),T(12)

13 function calls

so it should be the answer
selected by

Related questions

0 votes
0 votes
0 answers
1
adityaaswal asked Nov 30, 2018
510 views
Let G = (V,E) be a directed graph.Each edge of G is represented as (i,j) with length l[i,j].If there is no edge from i to j then l[i,j] = (IMAGE ATTACHED)
0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
Shamim Ahmed asked Nov 26, 2018
379 views
Which of the following procedure is suitable to find longest path from given vertex to any other vertex in Directed Acyclic Graph?Answer: Dynamic Programming.Why Greedy A...