Can someone please help me calculate the time complexity of this loop?

(Toggle Plain Text)

for(i = 1; i <= n; i = 2 * i)
for(j = 1; j <= i; j = 2 * j)

for(i = 1; i <= n; i = 2 * i) for(j = 1; j <= i; j = 2 * j)

Thank you.

Please use [code] tags for code. Where are you stuck? what have you tried so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.