Linked Questions

Popular Questions

What would be time complexity for loop running till 2 to power n

Asked by At

What would be time complexity for loop running till 2 to power n? Refer to below code snippet.

int[] arr={1,2,3,4};
for(int i=0;i<arr.length;i++){
    for(int j=0;j<Math.pow(2,i);j++){
        System.out.println(j);
    }
}

Related Questions