0 votes 0 votes Algorithms testbook-test-series algorithms time-complexity + – Tushar Shinde asked Jan 18, 2016 • edited Mar 11, 2019 by akash.dinkar12 Tushar Shinde 358 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes FIRST LOOP:intializes i=1 SECOND LOOP:intializes i=1; THIRD LOOP intializes i=1 and run till i=n^6 .. and when i checks for second iteration for 1st loop get.. condition failed ..and loops out ... THATS WHY ONLY n^6 times it get printed. Deepesh Kataria answered Jan 18, 2016 • selected Jan 18, 2016 by Tushar Shinde Deepesh Kataria comment Share Follow See 1 comment See all 1 1 comment reply Tushar Shinde commented Jan 18, 2016 reply Follow Share Ohh.. I mistook it for i, j , k :D Then the answer would have been n^12 , right? 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes HERE N^6 IS THE ANSWER BECAUSE every time variable i is initialized to 1 and so the previous 2 i values are ignored and the final loop is taken in consideration. this is what i think Aboveallplayer answered Jan 18, 2016 Aboveallplayer comment Share Follow See all 0 reply Please log in or register to add a comment.