1,004 views
2 votes
2 votes

Consider the following C segment:

main()
{
    int sum = 0; 
    for(int b=1; b<=n; b*=2)
    {
        for(int i=0; i<b; i++)
        { 
            for(int j=0; j<n; j+=2)
            { 
                sum += j; 
                
            } 
            for(int j=1; j<n; j*=2)
            {
                sum *= j; 
            }
        } 
        
    } 
    
}

The complexity of above program is ____________.

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
1 votes
1 votes
2 answers
3
Anjana Babu asked Dec 21, 2016
542 views
Write C Program using Recursive Funtions for the Problem Described below and Analyse the Complexity Of the CodeProblemGiven an unordered array arr[] which contains n di...
2 votes
2 votes
2 answers
4
dd asked Sep 25, 2016
510 views
#include <stdio.h int main() { int x,y = 0; //assume a[] as any array. for(x = 0; x < n; ++x) { while(y < n && arr[x] < arr[y]) y++; } return 0; }