0 votes 0 votes what is the time complexity for this code for(i=1; i<=n ; i++){ for(j=1; j<=log(i) ; j++){ //Do something } } Algorithms time-complexity algorithms + – Anilava Kundu asked Oct 24, 2018 edited Jun 10, 2022 by makhdoom ghaya Anilava Kundu 249 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Shaik Masthan commented Oct 24, 2018 reply Follow Share i=1 ===> j loop runs log (1) times i=2 ===> j loop runs log (2) times i=3 ===> j loop runs log (3) times ...... i=n ===> j loop runs log (n) times Total time runs = log(1) + log(2) + ....+ log(n) = log (1.2.3.4.....n) = log (n!) = log(nn) = n.log(n) 1 votes 1 votes MiNiPanda commented Oct 24, 2018 reply Follow Share O(nlogn) ? 1 votes 1 votes Anilava Kundu commented Oct 24, 2018 reply Follow Share Thank you for the explanation! 0 votes 0 votes Please log in or register to add a comment.