0

Time Complexity

can you find the time complexity of this code with full solution? (This is an exercise for those who want to practice getting the time complexity of algorithms...) code: *** for (int i = 1; i <= n; i++) for (int j = 1; j <= i; j++) for (int k = 1; k <= j; k++) x++; *** T(n) = n^3

7th Oct 2024, 6:36 PM
AraL
AraL - avatar
5 Respuestas
0
Is that your homework?
7th Oct 2024, 7:22 PM
Jerry Hobby
Jerry Hobby - avatar
0
Yes, and you can find it on Google yourself.
7th Oct 2024, 7:35 PM
Jan
Jan - avatar
0
Jerry Hobby No, in fact, I asked this question to challenge people as the first question of my discuss. I edited the description of my question for better clarity...
7th Oct 2024, 8:35 PM
AraL
AraL - avatar
0
Jan why google when we can use chatgpt? ;)
7th Oct 2024, 8:36 PM
AraL
AraL - avatar
0
AraL That's right, but anyway, I found it quite quickly on Google.
7th Oct 2024, 9:34 PM
Jan
Jan - avatar