I’m not sure Big O notation applies when your n is literally infinite universes…
And actually, on an even more pedantic note (if possible), if you are iterating through each array until you find an item out of order, and repeat this on every array, I’m fairly certain it’s more than O(n). Less than O(n^2) too, so it’s probably O(n*log(n))…but I’m a little out of my depth here
You’ve gotten it a bit mixed up. The n is the array size, not the number of universes. It takes O(n) to check if the array is sorted, and this happens once in every universe.
You seem to be envisioning some sord of 5D cross-universe program.
I’m not sure Big O notation applies when your
n
is literally infinite universes…And actually, on an even more pedantic note (if possible), if you are iterating through each array until you find an item out of order, and repeat this on every array, I’m fairly certain it’s more than
O(n)
. Less thanO(n^2)
too, so it’s probablyO(n*log(n))
…but I’m a little out of my depth hereYou’ve gotten it a bit mixed up. The
n
is the array size, not the number of universes. It takesO(n)
to check if the array is sorted, and this happens once in every universe.You seem to be envisioning some sord of 5D cross-universe program.