Skip to content

Lecture "Dynamic programming algorithms", exercise 1 #27

@essepuntato

Description

@essepuntato

Write an extension of the multiplication function introduced in the lecture "Recursion", i.e. def multiplication(int_1, int_2, solution_dict), by using a dynamic programming approach. This new function takes in input two integer numbers to multiply and a dictionary with solutions of multiplications between numbers, which can be used to retrieve directly the result of such multiplication if already present in it. The function returns the result of the multiplication and, at the same time, modifies the solution dictionary adding additional solutions when found.

Accompany the implementation of the function with the appropriate test cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExerciseThe exercises that are introduced in the lectures.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions