Question: Please write C++ programs to evaluate S(n ) for positive integer n>1. Please write both recursive algorithm and iterative algorithm. S(1)=5S(n)=2S(n1)+5forn>1 - Please create a


Please write C++ programs to evaluate S(n ) for positive integer n>1. Please write both recursive algorithm and iterative algorithm. S(1)=5S(n)=2S(n1)+5forn>1 - Please create a p 1.cpp for this question. Please create two functions in your p1.cpp : 0 int s_rec(int n) o int s_ite(int n ) - Please use for loops to display the first 10 items for S(n) relation by calling your recursive and iterative functions in main function : // The first 10 items for the relation S(n) using recursive algorithm: for(int i=1;i1. Please write both recursive algorithm and iterative algorithm. T(1)=2T(n)=nT(n1)+nforn>1 Please create a p2.cpp for this question. - Please create two functions in your p2.cpp: 0 int t _rec(int n) 0 int t-ite(int n ) - Please use for loops to display the first 10 items for T(n) relation by calling your recursive and iterative functions in main function : // The first 10 items for the relation T(n) using recursive algorithm: for ( int i=1;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
