Comment

Comment by DAllison

> Exact lookup in the trie is O(string_length), like a hash table

It's worth noting that some standard libraries (Java's JDK for one [1]) will cache the value of String.GetHashCode(), meaning string lookup in a HashTable is constant time average (but O(n) worst-case due to collisions).

[1]: http://mindprod.com/jgloss/hashcode.html

parent DAllison 10 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton