Assignment Set 2 (Uploaded on August 12, 2015) Clarification deadline: August 14, 2015 Submission deadline: August 17, 2015 before lab ends --------------------------------------------------------------------------- Problem 1: Write two C functions in the same program to do the following. Take as input a positive integer 'n' from the user. (a) Compute the Fibonacci number corresponding to 'n' in a iterative fashion. (b) Compute the Fibonacci number corresponding to 'n' in a recursive fashion. Compute the number of function calls to any 'fib(i)', where 0<=i<=n and find the total number of function calls. In both cases, check what is the largest 'n' for which you can find the Fibonacci number. For any particular 'n', compute and compare the real times taken by the iterative and recursive versions of the program. ---------------------------------------------------------------------------- Problem 2: Write a C program that takes as input two positive integers -- 'n' and 'm'; and generates two arrays A (of size n) and B (of size m) dynamically using pointers. Sort A and B. Now, generate dynamically a two dimensional array C, using pointer to pointer, of size n x m. Fill the array C as follows: C[i][j] = A[i]+B[j]. Now, sort the elements of C and fill it in a row major order as discussed in class. --------------------------------------------------------------- Naming conventions for program files. xx is your roll number: For Problem 1: The name of the file for problem 1 of assignment 2 should be ``cs15xx-assign2-prog1.c''. For Problem 2: The name of the file for problem 2 of assignment 2 should be ``cs15xx-assign2-prog2.c''. --------------------------------------------------------------- At the top of each of your program files, add the following. /*------------------------------------------------------------- Name: Roll Number: Date of Submission: Deadline date: Program description: Acknowledgements: --------------------------------------------------------------*/