Question: In C 4] Write two functions to calculate the numbers X(n) from the recursive problem above: Xn=Xn1+2Xn2, with the base cases X0=1,X1=8. - One function,

4] Write two functions to calculate the numbers X(n) from the recursive problem above: Xn=Xn1+2Xn2, with the base cases X0=1,X1=8. - One function, named xiter(n) uses the iterative algorithm. - Another function, named x Recu(n) uses the "brute force" recursive algorithm. The main function will print the values for n,xter(n) and xRecu(n) for n between 0 and 15 (inclusive). The numbers should be neatly aligned on the right. Make sure that the two functions return the same result! - Bonus: If you derived the Binet-style formula, implement it as well, and make sure it returns the same numbers! 5) Modify the Fit program we wrote in the lab to automatically convert an arrity of integers into a Singlyinked List (SLL). - Hinti Read each array element and add it to the SUL. - Hint if adding to the head of the list fwhich is easier, since there is no tail pointer), make sure you add the elements in teverse order, so the final list has them in the same order as the array. Use this starter code: Einchute cstdio ho minclude sitdibihs I/ A strucrure to repeesent eich nsde of a hishind list. struct Node f int vertNum, stnet Mode*" neve: I. I/ A utility function to dynamically oreate a scw node for the lieked list // Hetums a pointer ts the new node struct Node" createNewNode(int number) I struct Node* phewNode = (struct Node*) malloc|plaeoff(struct Nodells pNewNode svertsum = numbert pNewNodesinext = NULE Winitally unconcected return pNewNodes ) int maine I struct Node* head; / /pointer to the head of the list struct Node* crt; //pointer to the cument node in the Iat /This is the first node-DO NOT CHANGE beid until the lat it deleted! head n create*ewNode(42)a crt - head
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
