455 views
1 votes
1 votes
The complexity of this program?


int fun1 (int n) { 
     int i, j, k, p, q = 0; 
     for (i = 1; i < n; ++i) {
        p = 0; 
       for (j = n; j > 1; j = j/2) {
           p++; 
      for (k = 1; k < p; k = k * 2) 
           ++q;
     } 
     }
     return q;
}

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
1
atul_21 asked Jan 2, 2018
278 views
0 votes
0 votes
0 answers
2
Redcom1988 asked Dec 23, 2023
176 views
Design a counter according to the state diagram above using only NAND gates and JK Flip-flops (if needed) complete with state tables
0 votes
0 votes
0 answers
4
Parshu gate asked Dec 10, 2017
221 views