Question: Question I - Recursion [20 Points] Consider the following recursive C function: } To calculate F(5), how many times is the function F called? Show

Question I - Recursion [20 Points]

Consider the following recursive C function:

}

To calculate F(5), how many times is the function F called? Show your work. Question II - Recursion Coding [25 Points]

Question III - Sorting [20 Points]

a) You are given an array of ten integers. Sort this array using the Insertion Sort algorithm,

and show the array changes after each pass. [15 points]

65 45 17 67 1 3 19 80 7 21

b) What is the complexity of this algorithm in the worst case? [5 points]

int F(int n){

if (n >=9)

return n;

else

return F(n+1) * F(n+2);

write a recursive function to add a node at the end of a Singly Linked List. Consider only a data

field of type integer and a pointer next for each node. You only have the pointer head (pointer

tail is not given!).

Question I - Recursion [20 Points]Consider the following recursive C function:}To calculate

Question I- Recursion (20 Points) Consider the following recursive C function: int F(int n) { if (n >=9) return n; else return F(ntl) * F(n+2) ; To calculate F (5) , how many times is the function F called? Show your work. Question II - Recursion Coding (25 Points! Write a recursive function to add a node at the end of a Singly Linked List, Consider only a data field of type integer and a pointer next for each node. You only have the pointer head (pointer tail is not given!)

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 Mathematics Questions!