Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Trie
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Replacement for hash tables === A trie can be used to replace a [[hash table]], over which it has the following advantages:{{r|reema18|p=358}} * Searching for a node with an associated key of size <math>m</math> has the complexity of <math>O(m)</math>, whereas an imperfect hash function may have numerous colliding keys, and the worst-case lookup speed of such a table would be <math>O(N)</math>, where <math>N</math> denotes the total number of nodes within the table. * Tries do not need a hash function for the operation, unlike a hash table; there are also no [[hash collision|collisions]] of different keys in a trie. * Buckets in a trie, which are analogous to hash table buckets that store key collisions, are necessary only if a single key is associated with more than one value. * String keys within the trie can be sorted using a predetermined alphabetical ordering. However, tries are less efficient than a hash table when the data is directly accessed on a [[Computer data storage#Secondary storage|secondary storage device]] such as a hard disk drive that has higher [[random access]] time than the [[main memory]].<ref name="triememory">{{cite journal | author=Edward Fredkin| author-link=Edward Fredkin| title=Trie Memory| journal=Communications of the ACM| year=1960| volume=3| issue=9| pages=490β499| doi=10.1145/367390.367400 | s2cid=15384533| doi-access=free}}</ref> Tries are also disadvantageous when the key value cannot be easily represented as string, such as [[floating point numbers]] where multiple representations are possible (e.g. 1 is equivalent to 1.0, +1.0, 1.00, etc.),{{r|reema18|p=359}} however it can be unambiguously represented as a [[binary number]] in [[IEEE 754]], in comparison to [[two's complement]] format.<ref>{{cite web|publisher=Department of Mathematics and Computer Science, [[Emory University]]|title=The IEEE 754 Format|url=http://mathcenter.oxford.emory.edu/site/cs170/ieee754/|access-date=17 April 2022|author1=S. Orley|author2=J. Mathews|url-status=live|archive-date=28 March 2022|archive-url=https://web.archive.org/web/20220328093853/http://mathcenter.oxford.emory.edu/site/cs170/ieee754/}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Trie
(section)
Add topic