πŸ“Š Python
Q. What is the run time of the below code?
Code:
for i in range(n):
    j=1
    while(j<n):
        print(i,j)
        j*=2
  • (A) O(n)
  • (B) O(n^2)
  • (C) O(log(n))
  • (D) O(n*log(n))
πŸ’¬ Discuss
βœ… Correct Answer: (D) O(n*log(n))

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
195
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate