What would the Big O notation be for the following nested loops?
for (int i = n; i > 0; i = i / 2){
for (int j = n; j > 0; j = j / 2){
for (int k = n; k > 0; k = k / 2){
count++;
}
}
}
My thoughts are:
each loop is O(log2(n))
so is it as simple as multiply
O(log2(n)) * O(log2(n)) * O(log2(n)) = O(log2(n)^3)