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](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6708a3a18b525_4256708a3a174b58.jpg)
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
Get step-by-step solutions from verified subject matter experts
