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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:42:30+00:00 2026-06-04T10:42:30+00:00

Concerning Trie from Wikipedia: [Compared to HashTable] Tries support ordered iteration I am not

  • 0

Concerning Trie from Wikipedia:

[Compared to HashTable] Tries support ordered iteration

I am not sure what is meant here first of all. Is it the same as sorted iteration?
Additionally is this supposed to be an inherent feature of this datastructure?
I mean if one uses e.g. a HashSet for the children of each node in a Trie we can get O(1) access trying to find the children to branch or by using a LinkedList you save space on the nodes.
Perhaps I am way wrong but from my point of view the only way to support ordered iteration would be to keep array of all keys per node even unused.
Isn’t this approach bad?
And one last point:
If the ordered here is related to insertion order (and not sorted) how would we get that since we insert each word (using the chars as keys) to the corresponding node but I can’t see how this gives us information on the insertion order?
Could someone help me clear these things in my mind out?
Thank you.

  • 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-04T10:42:31+00:00Added an answer on June 4, 2026 at 10:42 am

    What they mean is that a depth-first search of the trie will yield a lexicographically ordered output of the strings in the trie.

    But yes, you are right, this assumes that all sibling nodes on a given level are visited in lexicographical order and this is far from given, especially with large alphabets, where it makes sense to implement the child node table via a hash table.

    In summary, I think your doubts are justified and that the Wikipedia article is wrong.

    But it’s worth noting that a lexicographically ordered iteration over a trie is affordable even if the child nodes aren’t ordered, since ordering them in while iterating is expected to be relatively cheap – there will be few child nodes in each trie node so the overall performance of iterating the trie will still be in O(n) expected time – in contrast with a hash table, where ordered iteration effectively implies sorting all elements, an O(n log n) operation.

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

Sidebar

Related Questions

Concerning headers in a library, I see two options, and I'm not sure if
My question is concerning how the Apple Developer program works. I am not yet
A follow up question concerning the DAL layer part .. The first question about
This is concerning chapter 3.5 from SICP, in which streams are being discussed. The
Concerning the use of the ->addCategoryFilter on a product collection. Why is it not
Concerning passive federation, I'm wondering how the transport of the security token from STS
I have an issue concerning constraints which should be generated dynamically from a list
I have a question concerning Monotouch. The situation: I have 2 ViewControllers. The first
I looked at the other questions concerning this topic, but could not get the
Concerning the .htaccess documenation, putting a .htaccess file in a directory should affect this

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.