Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You might want to use a <a href="http://en.wikipedia.org/wiki/Trie" rel="nofollow noreferrer">Trie</a> or other tree-based data structure for storing your string data. </p> <blockquote> <p>A trie can also be used to replace a hash table, over which it has the following advantages:</p> <ul> <li><p>Looking up data in a trie is faster in the worst case, O(m) time, compared to an imperfect hash table. An imperfect hash table can have key collisions. A key collision is the hash function mapping of different keys to the same position in a hash table. The worst-case lookup speed in an imperfect hash table is O(N) time, but far more typically is O(1), with O(m) time spent evaluating the hash.</p></li> <li><p>There are no collisions of different keys in a trie.</p></li> <li>Buckets in a trie which are analogous to hash table buckets that store key collisions are only necessary if a single key is associated with more than one value.</li> <li>There is no need to provide a hash function or to change hash functions as more keys are added to a trie.</li> <li>A trie can provide an alphabetical ordering of the entries by key.</li> </ul> <p>Tries do have some drawbacks as well:</p> <ul> <li>Tries can be slower in some cases than hash tables for looking up data, especially if the data is directly accessed on a hard disk drive or some other secondary storage device where the random access time is high compared to main memory.</li> <li>It is not easy to represent all keys as strings, such as floating point numbers, which can have multiple string representations for the same floating point number, e.g. 1, 1.0, 1.00, +1.0, etc.</li> <li>Tries are frequently less space-efficient than hash tables.</li> </ul> </blockquote> <p>(see <a href="http://en.wikipedia.org/wiki/Trie" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Trie</a>)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload