Questions tagged [trie]

6 questions
2
votes
1 answer

Algorithm for completeness of bit patterns with wildcards

Consider a list of bit patterns, each N bits long, and consisting of 0s, 1s, and x's to denote wildcards. For example, for N=8: 0110xx11 1111xx00 111xxxx1 10000000 ... Is there an algorithm for determining whether the list of bit patterns fully…
Mike
  • 23
  • 2
1
vote
1 answer

Algorithm for grouping "similar" strings

I have a situation where I am trying to group similar log error messages so that I can enable metrics on them. So, here are some live sample string: GROUP 1: Error:ESS-07033 Job logic indicated a system error occurred while executing an asynchronous…
1
vote
0 answers

Efficient generalized suffix array/tree construction for prefix trees

Is there any algorithm that can efficiently construct a generalized suffix tree or array (or something similar) for a set of strings represented by a prefix tree (trie)? In particular, I'm wondering: How time-efficient an algorithm for this can…
user541686
  • 1,187
  • 1
  • 10
  • 17
0
votes
1 answer

Trie minimization when order doesn't matter

How would I ensure I obtain a minimal trie when the order of elements is not important (ie - "abdc" is equivalent to "cbad" for my purposes)? To be clear, minimal means the least possible number of nodes while still maintaining a path for each…
Sprite123
  • 9
  • 2
0
votes
1 answer

Can a trie or DAWG loop?

I am looking at DAWGs, which are compressed tries, like this: It is an acyclic graph though, and I'm wondering if you are allowed to create loops or cycles in such a data structure. For example, I am thinking how to represent and store Turkish…
Lance Pollard
  • 2,323
  • 1
  • 19
  • 34
0
votes
1 answer

Is this Patricia tree implementation wrong?

I'm reading the chapter Radix Search of the book Algorithms (Robert Sedgwick). I've made a simple implementation and something isn't behaving as expected. In program 15.5 you can see that we start with an empty tree where the head is a null node. In…
sleekster
  • 3
  • 2