Let us take a simple code snippet running on a computer that iterates over an array
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array.length; j++) {
//print (i,j)
}
}
I understand that int i
contributes to Big O(1) whereas
array
contributes to Big O(array.length
) for Space Complexity.
Based on this, Can I estimate how much physical memory is being allocated for the algorithm?