10.4. Quiz
This section provides exercises for better understanding in dynamic programming.
Tower of Hanoi
Write a report quiz9.pdf that includes answers to the followings.
As
nincreases from1to10, how many times does the auxiliarysolve()method get called recursively inHanoiRecursiveandHanoiDynamic?Is there clear patterns between
nand the number of the method calls made by these classes? Explain the patterns if exist.
Longest Common Subsequence
Include answers to the followings in quiz9.pdf:
Explain what the values of the dynamic table mean in the
LCSDynamicclass.LCSDynamicpre-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.
Extra Credit
Create the
LCSQuizclass under thedynamic.lcspackage.Update the
solveAll()that returns all longest common subsequences between two strings.
Last updated
Was this helpful?