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 9129591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:47:07+00:00 2026-06-17T07:47:07+00:00

Because the trie data structure has such a huge branching factor and each subtree

  • 0

Because the trie data structure has such a huge branching factor and each subtree is totally independent of the others, it seems like there ought to be a way to enormously speed up trie construction for a given dictionary by adding all the words in parallel.

My initial idea on how to do this was the following: associate a mutex with each pointer in the trie (including the pointer to the root) and then have each thread follow the normal algorithm for inserting a word into the trie. However, before following any pointers, a thread must first acquire the lock on that pointer so that if it needs to add a new child node to the trie, it can do so without introducing any data races.

The catch with this approach is that it uses an enormous number of locks – one for each pointer in the trie – and does an enormous number of acquires and releases – one for each character in each input string.

Is there a way to build a trie in parallel without using nearly as many locks?

  • 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. Editorial Team
    Editorial Team
    2026-06-17T07:47:09+00:00Added an answer on June 17, 2026 at 7:47 am

    An obvious lock-free algorithm would be:

    1. Bucket-sort the input strings by a length-k prefix (ordinarily, k=1, but with small alphabets, increase k).
    2. For each letter, construct a trie containing the k-suffix of all the strings starting with that letter.
    3. Merge the tries from the previous step (when k=1, just add a root node).

    Assuming a uniform distribution of prefixes, this can give you a linear speedup up to the size of the alphabet to the power k.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a trie data structure in F#. I am having
Because data from file look like this: line 1 is name (first last), next
Because this is my first attempt at an extension method that seems quite useful
Because I'm lazy I was wondering if PHP has a shorthand way to set
Because hex is often used to represent things like RGBA color model data, I'm
Because of some rendering issues with UITextViews, I am dynamically creating UILabels for each
I naively implemented the trie from Okasaki's book Purely Functional Data Structures in Clojure.
Because of some reasons I have a spring application which has two client applications
Because shells other than ksh do not support pass-by-reference, how can multiple arrays be
Because my CSS3 animation uses over 50% of CPU in Chrome Browser 21.0 on

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.