for ( int i = 1; i < n*n*n; i *= n ) {
for ( int j = 0; j < n; j += 2 ) {
for ( int k = 1; k < n; k *= 3 ) {
cout<<k*n;
}
}
}
I am facing an issue with this exercise, where I need to find the big O notation of the following code, but I got O(n^5)
where the first loop is n^3
, 2nd loop n, and the 3rd loop is n
and I am not sure if I am correct or not. Can someone help me please?