# As A Warm Up Consider The Following Problem Where We Are Given As Input K Dance Move 2943048

As a warm up, consider the following problem where we are given as input k dance moves (d1, d2, . . . , dk)
and a non-negative strain factor si for each move di
, together with a sequence A of n moves.
(a) Describe an algorithm that computes RSI(A).
(b) Argue that your algorithm is correct.
(c) State and explain the complexity of you algorithm (in big-Oh notation).
(d) Implement your algorithm (submit this part to Ed). The input and output format is identical to
task 4, except the last line of input (B) is ignored, and the output is just a number.
Describe an algorithm for the DDR problem (“in plain English”). Your description needs to include
(a) A definition of the subproblems needed by your algorithm (i.e. what does the function OPT(. . .)
represent and what are its parameters).
(b) A definition of the recurrence(s) and base case(s) (i.e. what is the relationship between OPT(. . .)
for a subproblem in terms of OPT(. . .) for some other subproblems).
Justify the correctness of your algorithm. In particular, take care to prove that
• the recurrence is correct, and
• the base case(s) are correct and sufficient. Assignment-3-….pdf clarification….jpg