edited by
501 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

0 votes
0 votes
0 answers
1
usdid asked Apr 16, 2022
279 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 usin...
0 votes
0 votes
1 answer
3
Sanjay Sharma asked Jun 8, 2016
4,950 views
Which algorithm has same average, worst case and best case time ?Binary searchMaximum of n numberQuick sortFibonacci search
0 votes
0 votes
1 answer
4
LavTheRawkstar asked Jan 12, 2017
838 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[...