arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

10.4. Quiz

This section provides exercises for better understanding in dynamic programming.

hashtag
Tower of Hanoi

Write a report quiz9.pdf that includes answers to the followings.

  • As n increases from 1 to 10, how many times does the auxiliary solve() method get called recursively in and ?

  • Is there clear patterns between n and the number of the method calls made by these classes? Explain the patterns if exist.

hashtag
Longest Common Subsequence

Include answers to the followings in quiz9.pdf:

  • Explain what the values of the dynamic table mean in the class.

  • LCSDynamic pre-populates the dynamic table before making any recursive calls. Is it possible to find a LCS with dynamic programming by populating the dynamic table while making recursive class.

circle-info

You may need a different type of a dynamic table to populate it while making recursive calls.

hashtag
Extra Credit

  • Create the class under the package.

  • Update the solveAll() that returns all longest common subsequences between two strings.

HanoiRecursivearrow-up-right
HanoiDynamicarrow-up-right
LCSDynamicarrow-up-right
LCSQuizarrow-up-right
dynamic.lcsarrow-up-right