Mazdak Farrokhzad edited Version1.tex  over 10 years ago

Commit id: a0386463a82528232c53d4754465a7309126bc6b

deletions | additions      

       

$$T(n) = a + \sum_{i=0}^{n-1} f_3(n) = a + \sum_{i=0}^{n-1} (b + \sum_{j=i}^{n-1} (c + \sum_{k=i}^{j} d))$$  Each loop in the method corresponds to one sum or one method $f_i$ where the lowest index is the innermost sum/loop.      \begin{subequations}  Define the other functions:  \begin{align} 

\end{split}  \end{equation}  \begin{subequations}  After some simplification, we are left with:  $$ \begin{align}  \sum_{i=0}^{n-1} f_2(n,i) &  = \frac{d}{6}n^3 + (\frac{c}{2}+\frac{d}{2})n^2 + (\frac{c}{2}+\frac{d}{3})n   $$     $$ (\frac{c}{2}+\frac{d}{3})n, \\  T(n) &  = \frac{d}{6}n^3 + (\frac{c}{2}+\frac{d}{2})n^2 + (b + \frac{c}{2}+\frac{d}{3})n + a a,  \\ $$ \end{align}   \end{subequations}  Estimating constants:  \begin{enumerate}