Question: Lab 2 focuses on recursion design and time complexity analysis. In this lab, you will rewrite your Lab 1 program in a recursive approach, compare

Lab 2 focuses on recursion design and time complexity analysis. In this lab, you will rewrite
your Lab 1 program in a recursive approach, compare the time complexity between
different implementations and explain what causes the difference using Big O notation.
Task 0: Modify your Lab1 function so it only contains the code necessary to generate the Pascal
Triangle iteratively (still using a dynamically allocated 2d array). Take out any input/output
statements (cin/cout), so they dont affect time measurement in Task 2. Include this function in
your lab2.cpp. Your function prototype should look like:
int** iterativePascal(int degree)
//returns 2d array filled with Pascal Triangle values up to given degree
Task 1: Write function recursiveBico(int degree, int index) using recurs

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