Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:58:37+00:00 2026-05-10T18:58:37+00:00

So if I have to choose between a hash table or a prefix tree

  • 0

So if I have to choose between a hash table or a prefix tree what are the discriminating factors that would lead me to choose one over the other. From my own naive point of view it seems as though using a trie has some extra overhead since it isn’t stored as an array but that in terms of run time (assuming the longest key is the longest english word) it can be essentially O(1) (in relation to the upper bound). Maybe the longest english word is 50 characters?

Hash tables are instant look up once you get the index. Hashing the key to get the index however seems like it could easily take near 50 steps.

Can someone provide me a more experienced perspective on this? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:58:38+00:00Added an answer on May 10, 2026 at 6:58 pm

    Advantages of tries:

    The basics:

    • Predictable O(k) lookup time where k is the size of the key
    • Lookup can take less than k time if it’s not there
    • Supports ordered traversal
    • No need for a hash function
    • Deletion is straightforward

    New operations:

    • You can quickly look up prefixes of keys, enumerate all entries with a given prefix, etc.

    Advantages of linked structure:

    • If there are many common prefixes, the space they require is shared.
    • Immutable tries can share structure. Instead of updating a trie in place, you can build a new one that’s different only along one branch, elsewhere pointing into the old trie. This can be useful for concurrency, multiple simultaneous versions of a table, etc.
    • An immutable trie is compressible. That is, it can share structure on the suffixes as well, by hash-consing.

    Advantages of hashtables:

    • Everyone knows hashtables, right? Your system will already have a nice well-optimized implementation, faster than tries for most purposes.
    • Your keys need not have any special structure.
    • More space-efficient than the obvious linked trie structure (see comments below)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that appends some rows to a table. One of the
Did you ever have to choose between WISA or LAMP at the beginning of
When I design classes and have to choose between inheritance and composition, I usually
I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha
I have to choose a platform for our product. I have to decide between
I have to choose a server pages technology for a few server components that
if you have to choose between two image application on a mac Drawit ($38)
If I have to choose between static method and creating an instance and use
I find my self in a situation where I have to choose between either
The vcvarsall.bat that does setup de build environment let you choose between x86 |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.