edited by
545 views
0 votes
0 votes
  1.  what is the running time of the following iterative algorithm?
    b) It is possible to talk about the best, average and worst running times for this algorithm. Why?

 

pseudo code

Ci

The number of repetitions

ci × Number of repetitions

for i=1 to n

 

 

 

do

 

 

 

j=1;

 

 

 

While (j<n)

 

 

 

do

 

 

 

j=j*2;

 

 

 

                         

                                                Total:

 

T(n)=

 

           

 

edited by

Please log in or register to answer this question.

Related questions

295
views
0 answers
0 votes
usdid asked Apr 16, 2022
295 views
a) what is the iterative equation showing the running time of the algorithm whose pseudocode is given below? b) What is this repeated equation in asymptotic notation using the Master' ... 0 for i=1 ton do total = total + i*i print total
261
views
0 answers
0 votes
usdid asked Apr 16, 2022
261 views
1 question:a) Calculate the running time of the following iterative algorithm. For this purpose, write the working time of each row in the corresponding column of the table in terms of ci ... Total: T(n)=
5.1k
views
1 answers
0 votes
Sanjay Sharma asked Jun 8, 2016
5,081 views
Which algorithm has same average, worst case and best case time ?Binary searchMaximum of n numberQuick sortFibonacci search
866
views
1 answers
0 votes
LavTheRawkstar asked Jan 12, 2017
866 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i > 0 and A[i] > key) { A[i+1] ← A[i]; i ← i – 1; }A[i+1] = key;