_ - 5 (int n) {_

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter14: Exploring Object-based Programming: Designing An Online Poker
Section14.1: Visual Overview: Custom Objects, Properties, And Methods
Problem 7QC
icon
Related questions
Question

Please explain the answer of getting the exact running time of the program. The attached photo's answer is already correct only the explanation of getting the exact running time is needed. 

Q5
int quiz.
int ij, k, sum -0;
for Cil; i coh, i 'E
5 (int n) {_
Tini (1) = 2 Tina(G) + 2i +2
E 2n +2 +2i+2
1 2 +zi+2
2 E n
= 2ni + 2i + 2i tz
Tim li) * a 2ni + 4i +2
for (ka ; kean; ktz){
assume de logen
Ta (n)= E Tinli) + ed +3
EA 2ni + ai +2 + 2d +3
= en Ei t4 Ei+e +ed s
+ 4. (dd) + ed +zd +3
d'n + dn + 2d°+ 2d +2d +2d +3
= d'n + zd? + dn+ ad +3
Sum "sum F
Ting (n)= 42
* 2n +2
return sumi
%3D
TG) = n(log,n)" + 2(bganDFinlogan + c logun r3_
T (n) = n Clogan)F + 2Clogan)" +n lagn +G lagan t3
Transcribed Image Text:Q5 int quiz. int ij, k, sum -0; for Cil; i coh, i 'E 5 (int n) {_ Tini (1) = 2 Tina(G) + 2i +2 E 2n +2 +2i+2 1 2 +zi+2 2 E n = 2ni + 2i + 2i tz Tim li) * a 2ni + 4i +2 for (ka ; kean; ktz){ assume de logen Ta (n)= E Tinli) + ed +3 EA 2ni + ai +2 + 2d +3 = en Ei t4 Ei+e +ed s + 4. (dd) + ed +zd +3 d'n + dn + 2d°+ 2d +2d +2d +3 = d'n + zd? + dn+ ad +3 Sum "sum F Ting (n)= 42 * 2n +2 return sumi %3D TG) = n(log,n)" + 2(bganDFinlogan + c logun r3_ T (n) = n Clogan)F + 2Clogan)" +n lagn +G lagan t3
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning