need help in Python programming
Learning Objectives
You will learn how to create and analyze a recursive algorithm. You
will learn about the difference between iterative and recursive
algorithms.
Exercise 1: Recursion vs. iteration
a) Create a recursive function that finds the nth element A (n) in
the formula A (n) = A (n-1) + 1 / n, A (1) = 1. The function should
take the number n as a parameter. This represents series 1 + 1⁄2 +
1/3 + 1⁄4 + ... + 1 / n.
b) Find the recurrence equation for the function from Problem
a)
c) Find the running time of the function from task a)
d) Create an iterative function to find the same element as in
Problem a) using
dynamic programming.
e) Find the run time of the iterative function in O notation
a)
CODE

b)
The recurrence relation is given as:
T(n) = T(n-1) + c where c is a contsant
c)
On solving, we get,
T(n) = O(n)
NOTE: As per Chegg policy, I am allowed to answer specific number of questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
need help in Python programming Learning Objectives You will learn how to create and analyze a...