My issue
how you come to the answer?? Please explain me the approach
Learning course: Time complexity using C++
Problem Link: CodeChef: Practical coding for everyone
how you come to the answer?? Please explain me the approach
Learning course: Time complexity using C++
Problem Link: CodeChef: Practical coding for everyone
@satyamkumar1a2
the i loop is running n time .
and inside i loop j loop is running log (n).
log(n) because instead of j++ we are doing j=j*2 . which means for n=32 j loop will run 5 times .
which is log(n) .
so the total complexity will become O(nlog(n)).