If a pointer specifies a point in memory, would the amount of space a pointer takes not be dependent on how much memory it could possibly range over?

So for example, if we have 4 locations of memory and a pointer, then the pointer can be 2 bits, but if we have $2^k$, we will need $k$ bits.

My confusion stems from people who say that a fixed number of pointers is $O(1)$ space complexity.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.