Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
DarkWiiPlayer
on Oct 18, 2018
|
parent
|
context
|
favorite
| on:
Ask HN: What's your favorite elegant/beautiful alg...
Doesn't that mean in the end you have to check 127 values for if they are 0?
Or 64, if you store numbers as 32-bit integers and compare them as 64-bit using a union type.
karmakaze
on Oct 18, 2018
[–]
You could also keep a counter of the number of non-zero entries and update on zero/non-zero transitions.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Or 64, if you store numbers as 32-bit integers and compare them as 64-bit using a union type.