Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tomcatfish
· 3w ago · 0 comments
You do not need a hashtable to check that, code that returns a TRUE if (opt1)|(opt2)|(opt3)|(op4)|(etc) matches or FALSE otherwise works just fine.
Comments
[–]
dreamcompiler
3w ago
Of course this works and it's simple, but it's O[n] in the number of options. Perfect hashing is O[1].