Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is impractical a lot of the time. There are a class of problems where you want to put 2^N + 1 possible values in an N bit container, and it won't ever fit cleanly. Null is that 1 extra value that won't fit cleanly.

Another case is an array based queue. It can be implemented with head+tail pointers, or size+offset. However, there will always be an ambiguity with either, because two words of memory aren't enough to represent all possible states of the queue.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: