Silvio Peroni
Silvio Peroni
Write in Python the pure iterative version of the function defined in the [previous exercise](#29).
Write in Python a recursive function `def breadth_first_visit(root_node)` that takes the root node of a tree and returns a list containing all the nodes of the tree according to a...
Write an algorithm for using the merge sort (introduced in the [previous lecture](https://comp-think.github.io/2018-2019/lecture-notes/09%20-%20Divide%20and%20conquer%20algorithms.pdf)) so as to use a dynamic programming approach in case the same list of books must be...
Write an extension of the multiplication function introduced in the [lecture "Recursion"](https://comp-think.github.io/2018-2019/lecture-notes/08%20-%20Recursion.pdf), i.e. `def multiplication(int_1, int_2, solution_dict)`, by using a dynamic programming approach. This new function takes in input two...
See: https://doi.org/10.5281/zenodo.2204836
Develop the divide and conquer algorithm `def quicksort(input_list, start, end)` that takes a list and the positions of the first and last elements in the list to consider as inputs,...
Define a recursive function `def fib(n)` that implements the algorithm to find the nth Fibonacci number – where if `n` is less than or equal to 0, then 0 is...
Define a recursive function `def exponentiation(base_number, exponent)` for implementing the exponentiation operation, and test (by implementing the related test case) it on the following inputs: 34, 171, and 20.
Write a pseudocode in Python so as to create a set of the following elements: `"Bilbo"`, `"Frodo"`, `"Sam"`, `"Pippin"`, `"Merry"`.
Write in Python the function `def my_range(stop_number)` which behave like the built-in function `range()` introduced in [Section "Insertion sort"](https://comp-think.github.io/2018-2019/lecture-notes/06%20-%20Brute-force%20algorithms.pdf) and returns a proper list, and accompany the function with the...