Y
Hacker News
new
|
ask
|
show
|
jobs
by
heeen
3434 days ago
> "There is no reason a person should know which class they are in, nor should a class know which people are enrolled in it. "
Also replacing a O(1) chasing a pointer into a O(n) array search
1 comments
db48x
3434 days ago
Or with a hash-table lookup, left as an exercise to the reader.
link