CMPT 280 Chapter : compilerTiming.rtf
Document Summary
Recall the fetch execute cycle and that each operation that takes place takes a specific amount of time based upon the architecture that the code is running on. 4b (t(f) + t(f) + t()) * (n + 1) 3c (2t(f) + t(-) + t(s)) * n. 5 ( 5t(f) + t([]) + t(+) + t(*) + t(s)) * n. T(f) + t(return) if (n == 0) int factorial( int n) 6 else return 1; return n * factorial(n-1); n = 0. Given that t(n) = t(n-1) + t2, then we may also write t(n-1) = t(n-2) + t2, provided n > 1. Since t(n-1) appears in the right hand side of the latter.