Question: I already did the recursive function part, but I don't know how to push them into the function vector and call them to use Part

 I already did the recursive function part, but I don't know

I already did the recursive function part, but I don't know how to push them into the function vector and call them to use

Part 4: A Vector of Functions If you only need to make tables for 2 functions, this still isn't a huge advantage Let's implement all the following integer functions You MAY NOT use math libraries for the below. Implement them using recursion 1. two n() olf n=0, 2^0 = 1 Else 2^n=2*2^(n-1) 2. factorial(n) Else n!=n*(n-1)*(n-2) *2*1 o 3. fib(n) lf n = 0, then fib(0) = 0 lf n-1, then fib(1) = 1 o Else fib(n)-fib(n-1)+fib(n-2) 4. perrin(n) If n = 0, then perrin(0) = 3 If n = 1, then perrin(1) = 0 If n = 2, then perrin(2) = 2 o o Else perrin(n) perrin(n-2)+perrin(n-3) We want to make a vector of all of our functions as well as a vector of strings to title each function when it is pinted out. You can create a vector of functions as vector my functions; Populate the vectors. Use a loop to call make_function table on these 4 new functions as well as the square and cube functions from parts 1 and3

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!