Skip to main content

Questions tagged [trie]

A trie is a data-structure used for matching strings in a set of strings using a tree like structure. It can be either a prefix or a suffix trie. This tag shall not be confused with trees.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
145 views

A Hashed Array Mapped Trie has a time complexity of log32(n). According to the paper referred by this implementation, the 32 comes from the cardinality of the alphabet, which in this case is a 32 bits ...
Bharel's user avatar
  • 163
1 vote
1 answer
105 views

I am playing around with a cross-language spell-check sort of thing, and am still in the prototyping/ideation phases. Basically I have thought of something like a Trie data structure, but I keep ...
Lance Pollard's user avatar
2 votes
3 answers
1k views

I have a stream of documents, each having an ID which is a 64 bit unsigned long given as a (maximum length is 20) string. Sometimes an ID appears multiple times in the stream. I don't want to process ...
uylmz's user avatar
  • 1,139
1 vote
1 answer
406 views

I was watching the Coursera algorithms lecture series' portion on tries. R-way tries are introduced first, where each node has an array the size of the possible character space (R) with potential ...
Casey's user avatar
  • 273
1 vote
1 answer
2k views

I have a spring boot application, that simply does, takes a set of characters and lists out possible english words. Now, as everyone knows , its fairly easy, build a trie data-structure to load up a ...
MithunS's user avatar
  • 127
2 votes
1 answer
956 views

I am working on trying to understand HAMT and now am uncertain generally what to do when you run into a conflict in a hash. All I understand so far is you create a list to append the keys to, but I ...
user10869858's user avatar
2 votes
0 answers
37 views

By that I mean, forming a Hash Array Mapped Trie with 2 or more indexed fields, such as a User model by email and location name, or email + username + last logged in + isActive. Basically any ...
user10869858's user avatar
0 votes
0 answers
114 views

Say I have a database with 100 tables. Scattered throughout the tables are some string columns for short things that could be considered usernames/tags/categories/hashtags/addresses/placenames/other ...
user10869858's user avatar
6 votes
1 answer
1k views

While reading on the design for autosuggest implementation on large scale systems (like google), I'm able to understand the usage of trie and how top "n" terms are stored at each node to quickly ...
user2599672's user avatar
2 votes
1 answer
358 views

I'm working on a trie data structure. My simple, initial understanding: trie data structures require a fixed root node. This node cannot be deleted. When iterating through all nodes in a trie (in ...
Brannon's user avatar
  • 371
0 votes
1 answer
984 views

I am wondering about how range queries work, and the standard solution is to use B+trees. However, I am a fan of tries as a general data structure and would like to know if they (or variations of them)...
Lance Pollard's user avatar
6 votes
3 answers
14k views

There is a quite a bit of information about the time complexity of inserting words into a Trie data structure, but not a whole lot about the space complexity. I believe the space complexity is O(n**m)...
perseverance's user avatar
10 votes
5 answers
10k views

So, I am trying to create an English language trie data structure implementation in C++. I have created a Trie and TrieNode class. The TrieNode class takes in its constructor a vector<string> ...
Bassinator's user avatar
-2 votes
1 answer
615 views

I am looking to implement a custom autocomplete functionality for a travel website with huge amounts of data. I am thinking of implementing it using a trie. But how do I handle it if the data cannot ...
Nikant's user avatar
  • 139
3 votes
1 answer
132 views

I am working with a system that is using NoSQL (Azure Table Storage) primarily to house its data. Unfortunately, the work also involves billing and medical records - meaning the data itself will need ...
Telastyn's user avatar
  • 110k
9 votes
1 answer
8k views

I want to implement a data structure that will hold the paths of directories, sort of fake file system. Input:- I have a text configuration file containing the paths as follows ... C:/temp1 C:/...
user3054204's user avatar
2 votes
1 answer
2k views

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs: User's group name Group events (dependent drop-down) Locations (dependent drop-down) ...
ekjot's user avatar
  • 21
4 votes
3 answers
3k views

I am trying to find common prefixes for a sorted set of strings. i.e. if the following strings are given: AB123456 AB123457 ABCDEFGH ABCDEFGX1 ABCDEFGY XXXX then my function should return three ...
cruppstahl's user avatar
3 votes
1 answer
861 views

So, quite often I'll come across a situation where I'd like to process hostnames in a hierarchical manner. For example, given a hostname "foo.bar.baz.example.com", I might want to compare it against ...
Siler's user avatar
  • 421
3 votes
4 answers
3k views

TL;DR Is there a data structure that'd quickly let me match words at any point (e.g., 'foo' matches 'foobar' and 'zoofoo'), and, ideally, returns a list of "characters that show up after the needle" ...
Tordek's user avatar
  • 454
5 votes
2 answers
1k views

I am given a set of sets: {{a,b}, {a,b,c}, {a,c}, {a,c,f}} I would like to have a data structure to index those sets such that the following "lookup" is executed fast: find all supersets of a given ...
Asterios's user avatar
  • 161
15 votes
2 answers
6k views

I have been looking for an efficient String trie implementation. Mostly I have found code like this: Referential implementation in Java (per wikipedia) I dislike these implementations for mostly two ...
RokL's user avatar
  • 2,451
22 votes
2 answers
2k views

Going through some old Hacker News items, I came across a post from a user that said Aguri trees, which marry a bounded-size radix trie (like you'd use in a software routing table) to an LRU list, ...
phwd's user avatar
  • 458
3 votes
3 answers
550 views

It has a single root and each node has 0..N ordered sub-nodes . The keys represent a distinct set of paths. Two trees can only be merged if they share a common root. It needs to support, at minimum: ...
Daniel's user avatar
  • 699