0 votes 0 votes How to analyze this problem For (I=1;I<n;I++) { For (j=1;j<n;j=j+I) { Print("℅d℅d", I,j); } } Please suggest I'm detail how do we unroll I & j. Algorithms time-complexity algorithms + – Mayankprakash asked Jan 3, 2019 Mayankprakash 415 views answer comment Share Follow See 1 comment See all 1 1 comment reply Shaik Masthan commented Jan 3, 2019 reply Follow Share this may help you https://gateoverflow.in/228545/ubc-intermediate-algorithm-design-analysis-cpsc-summer-2009 https://gateoverflow.in/228411/test-series-algorithms https://gateoverflow.in/100616/algorithm 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes first loop runs n times. second times runs n/2 times …………... ……………. last loops runs 1 times hence n+n/2+n/3+n/4…………….1 T.C=O(n logn). arun yadav answered Sep 24, 2020 arun yadav comment Share Follow See all 0 reply Please log in or register to add a comment.