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

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer First of all, you say reload, but assuming you mean… May 11, 2026 at 12:11 pm
  • added an answer is it possible to return items that include 3 in… May 11, 2026 at 12:11 pm
  • added an answer Solved by adding if(!IsPostBack) ucEnquiryList.Bind(EnquiryMethods.BuildQuery(new EnquiryQuery())); May 11, 2026 at 12:11 pm

Related Questions

So if I have to choose between a hash table or a prefix tree
So I have a pointer to an array of pointers. If I delete it
I have just started to look at .NET 3.5 so please forgive me if
So, I have this situation where I need to see if an object is
Currently, I am splitting all my tests by package (projects). So if I have
If I have an HTML helper like so: Name:<br /> <%=Html.TextBox(txtName,20) %><br /> How
Alright so I have this C++ image capturing class. I was wondering if I
So I have this regex: (^(\s+)?(?P<NAME>(\w)(\d{7}))((01f\.foo)|(\.bar|\.goo\.moo\.roo))$|(^(\s+)?(?P<NAME2>R1_\d{6}_\d{6}_)((01f\.foo)|(\.bar|\.goo\.moo\.roo))$)) Now if I try and do a match
So, I am seeing a curious problem. If I have a function // counter
I don't have too much experience with C# so if someone could point me

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.