|
|
|
|
|
by jemfinch
935 days ago
|
|
> Now we can make an assumption that the int it's a finite number say u32, this means we can construct a binary tree with a depth of 32 with access time of O(32) therefore O(1) time and space. Heck, let's go even further. All the computers I've used have a fixed amount of memory, addressable by a u64, so I guess all my algorithms are constant time now. I guess we've solved the interview, folks. |
|
If we considered the bits of integers as the smallest unit of work in all cases (it is of course relevant to consider bits as the unit of work in some cases), then big-O notation becomes a lot more tedious without typically adding more value.
See: https://cs.stackexchange.com/questions/140642/silly-question...