Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In general, the hardest task of dynamic programming is to find and define the right recursion for the problem a recursion that makes exponentially-many recursive

In general, the hardest task of dynamic programming is to find and define the right recursion for the problem a recursion that makes exponentially-many recursive calls in a direct implementation, and yet all of the calls are in some poly-size domain. For each problem below, find such a recursion. Then explain how you solve the problem in a bottom-up fashion by using a suitably defined array and a formula to fill the array based on previously-filled cells. For this problem you do not need to write a pseudocode as part of your explanation.image text in transcribed

Question 2 (10 marks) In general, the hardest task of dynamic programming is to find and define the right" recursion for the problem a recursion that makes exponentially-many recursive calls in a direct implementation, and yet all of the calls are in some poly-size domain. For each problem below, find such a recursion. Then explain how you solve the problem in a bottom-up fashion by using a suitably defined array and a formula to fill the array based on previously-filled cells. For this problem you do not need to write a pseudocode as part of your explanation. a. (5 marks) The LONGEST SUB-PALINDROME problem: given a sequence X (zi, ...,an) find the longest subsequence 21 ...,zik) such that ij i for any j, and that is a palindrome: k is even and (z j+1 the inverse sequence (z rk-1 i is identical to the original sequence 21 in). (E.g abba is a Ti sub-palidrome of "tablebrand.") b. (5 marks) The LONGEST SIMPLE PATH problem: Suppose that we are given a directed acyclic graph G (V, E) with real-valued weights and two distinguished vertices s and t. The goal is to find a longest weighted simple path from s to t

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions