retagged by
1,650 views
1 votes
1 votes

retagged by

2 Answers

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})$

Related questions

0 votes
0 votes
2 answers
1
Gate Fever asked Sep 27, 2018
2,057 views
0 votes
0 votes
1 answer
2
0 votes
0 votes
3 answers
3
1 votes
1 votes
2 answers
4
srestha asked Aug 17, 2018
1,084 views
What will be TC here?Ans given $O(n^{2})$ , while I am getting $O(n)$