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!).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started