I need to figure out the execution time of the following algorithm in terms of n.

x=2

while (x < n) {

x=2^x

}

I think it is O(log n) but just wanted to get some confirmation to make sure I am approaching this correctly. Thanks.

This topic has been dead for over six months. Start a new discussion instead.

Recommended Topics