Question: I am reposting this question because the answer to part (b) provided to me previously needs to be corrected. It was incorrect, as built-in functions

I am reposting this question because the answer to part (b) provided to me previously needs to be corrected. It was incorrect, as built-in functions were utilized!

The question requires knowledge of Data Structures and Algorithms. Any code required is to be done in Python.

- Part (b) requires a base case for the recursive algorithm. Also, do not use built-in FUNCTIONS. Refer to the images below on how to implement a recursive function.

- Please provide detailed and clear explanations.

I am reposting this question because the answer to part (b) providedto me previously needs to be corrected. It was incorrect, as built-in

(a) Implement a function in Python to create a list: [5,1,7,[4,9,6],[3,6,7]] and display each element of it. (5 marks) (b) Implement a function recursive_sum() in Python that can sum all elements from the list created in Question 3(a). Do not use the built-in functions in implementing your solution. (5 marks) Content of Recursive Function - base case: - values of the input variables for which no recursive calls is def factorial_func(n): if n=0 : \# base case return 1 else: \# recursive case return ( n factorial_func (n1)) def fibonacci (n) : if n=1: base case return 0 if n=2 : \# base case return 1 else: \# recursive case return fibonacci (n1) + fibonacci (n2) performed - at least one base case else: \# recursive case - The base case is the condition to stop the recursion which means return (n*factorial_func (n1) ) every possible chain of recursive calls must eventually reach a base case - recursive case if n==2: base case - The recursive case is the part where the function calls on itself. else: \# recursive case - Make progress towards a base case. return fibonacci (n1)+fibonacci(n2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!