Given the following code snippet, find the following:1) Recurrence relation of func (x,y) when x>0 and length of y is n. Express in the form below:T(x,n) = T(?) + O(?)For 2-3, consider worst-case...


Given the following code snippet, find the following:
1) Recurrence relation of func (x,y) when x>0 and length of y is n. Express in the form below:
T(x,n) = T(?) + O(?)


For 2-3, consider worst-case scenario and initial value of y as [1]
2) Time complexity of func (x,y)
3) Space Complexity and Auxiliary Space Complexity of func (x,y)


1 v def func (x, y=[1]):<br>2 v<br>if x <= 1:<br>3<br>return y<br>y_2 = [y[integer] + y[integer+1] for integer in range (len(y)-1)]<br>return function(x-1, [1] + y_2 + [1])<br>4<br>5<br>

Extracted text: 1 v def func (x, y=[1]): 2 v if x <= 1:="" 3="" return="" y="" y_2="[y[integer]" +="" y[integer+1]="" for="" integer="" in="" range="" (len(y)-1)]="" return="" function(x-1,="" [1]="" +="" y_2="" +="" [1])="" 4="">

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here