1 votes 1 votes Algorithms algorithms time-complexity test-series + – HeadShot asked Aug 8, 2018 • retagged Jul 16, 2022 by Anjana5051 HeadShot 1.7k views answer comment Share Follow See all 18 Comments See all 18 18 Comments reply Show 15 previous comments HeadShot commented Aug 10, 2018 reply Follow Share @MiNiPanda 1^2 + 2^2 +....+ n^2 = n(n+1)(2n+1)/6 O(n^3) 1st loop -> O(n) => O(n^4) correct ? 0 votes 0 votes srestha commented Aug 14, 2018 reply Follow Share Can u tell me what is answer given? 0 votes 0 votes MiNiPanda commented Aug 14, 2018 reply Follow Share O(n* logn * loglogn ) though i don't know how :P 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes time complexity will be $O\left ( n^{n+1} \right )\cong O\left ( n! \right )$ Here is the calculation So, for $j$ it will be $O(n^{n})$ and for $k$ it will be $O(n)$ So, T.C. will be $O(n^{n+1})$ srestha answered Aug 14, 2018 srestha comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments srestha commented Aug 14, 2018 reply Follow Share ohk finally, is it right then? 0 votes 0 votes Shaik Masthan commented Aug 14, 2018 reply Follow Share mam, till now i didn't check it.......... i will check and comment 0 votes 0 votes srestha commented Aug 14, 2018 reply Follow Share ohk.. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes nlognlog(lonn!)=O(nsquare logn loglogn) Chandrabhan Vishwa 1 answered Aug 8, 2018 Chandrabhan Vishwa 1 comment Share Follow See all 0 reply Please log in or register to add a comment.