Using dynamic programming and divide and conquer, write an algorithm and analyze it using python or Java

Consider the function intHowManyWays(int n) where n is the number of matrices to be multiplied and returns the number of ways to fully parenthesize them (the number of different ways to multiply the n matrices).

1. Write an algorithm using the divide and conquer technique.

2. Analyze your algorithm from part 1. What is the time complexity?

3. Write an algorithm using the dynamic programming technique.

4. Analyze your algorithm from part

3. What is the time complexity?

5. Implement your algorithms from parts 1 and 3. 6.Include test cases for n = 2, 3, 4, 5, 6, 7……

7. Compare the time it takes to execute both techniques

8. Send the code, a sample run for the different test cases and the time comparison.

× How can I help you?