What is the time complexity for the below-given block of code where i, j, and n are integers and lines of code do not contain any extra line space between them?

                for(i = 0; i < n; i ++ ) {

                for(j = m ; j > 0; j = j/2) {

 printf(“Hello world” ); } }

1
O(n) + O(log2m)
2
O(n × m)
3
O(n × log2m)
4
O(n + log2m)

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation