#include using namespace std; /* * T(5) = 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 */ // O(1) double T(double n){ double sum = 0.0; for(int x = 1; x <= 10; x++){ // 10 iterations regardless sum += n; } return sum; } // O(n) long Factorial(long n){ long prod = 1; for(int x = 1; x <= n; x++){ prod *= x; } return prod; } int main(){ cout << "T(8) = " << T(8) << endl; cout << "Factorial(20) = " << Factorial(20) << endl; return 0; }