Explanation : Θ(n3)
So, this is in Θ(log n)
Hence Answer is (B)
The outer for-loop goes for iterations. The
inner for-loop runs independent of the otuer loop. And for each inner iteration n/2 gets added to k.
∴ Answer = n/2 x # outer loops x #Inner loops per outer loop
# Inner loops = Θ(log n) [∵2 Θ(log n) = Θ(n)]
∴ Answer =