Questions tagged [suffix-tree]

A suffix tree is a data structure that stores all suffixes of a string. It is the basis for many fast algorithms on strings.

228 questions
1
vote
1 answer

an algorithm - suffix tree

Given a generalized suffix tree of 2 strings : st1 and st2. Need to find an algorithm that marks every node V in 1 (and/or 2) if there is a leaf in the sub-tree that goes out of V that represents suffix of st1 (and/ or st2 respectively). my guess is…
Ohad
  • 1,563
  • 2
  • 20
  • 44
1
vote
1 answer

What is the advantage of generalized suffix tree over prefix tree?

It will be of great help if some-one explains the reason in bit detail and in which scenario one is more advantageous than the other. Thanks in advance !!
aroyc
  • 890
  • 2
  • 13
  • 26
1
vote
1 answer

Ukkonen's suffix tree algorithm with Leaf-label

I have read the post Ukkonen's suffix tree algorithm in plain English?. But it is unclear how to get the leaf label using this algorithm. In suffix tree the leaf-label is the number i such that S[i..n] is the suffix that the leaf represent. If I…
w00d
  • 5,416
  • 12
  • 53
  • 85
1
vote
1 answer

Haskell: Algebraic types error (Suffix trees: recursion)

Working on a function that given a SuffixTree as input, outputs the list of integers in that suffix tree. For example. getIndices tree1 = [2,4,1,3,5,0] . The order of the list of integers does not matter. I am getting the error, on the second last…
j x
  • 317
  • 3
  • 12
1
vote
1 answer

Depth-first search

I have a suffix tree, each node of this tree is a struct struct state { int len, link; map next; }; state[100000] st; I need to make dfs for each node and get all strings which I can reach, but I don't know how to make. This is my dfs…
Mike Minaev
  • 1,912
  • 4
  • 23
  • 33
1
vote
1 answer

Modifying a Generalised Suffix Tree to hold number of times a node appears in the text string

How do I modify the procedure in Ukkonen's paper to hold a value for number of times a word appears in the text. Are there any such implementations available that provide the string frequency as well? The modification I want is like for a string…
Salena
  • 155
  • 1
  • 8
1
vote
2 answers

Token Suffix Tree Tutorial

Can someone please point to tutorials on - "Token Suffix Trees".
Susheel Javadi
  • 3,034
  • 3
  • 32
  • 34
1
vote
1 answer

Suffix Tree and B-Tree

Just a quick question: Is a suffix tree (a tree that stores suffixes of words) a type of b-tree please?
Goaler444
  • 2,591
  • 6
  • 35
  • 53
1
vote
1 answer

Are there well known algorithms to count substrings in a Suffix Tree?

I've implemented an algorithm to construct a Suffix Tree. Now, I'm trying to implement a method count that returns the number of times query occurs as a sublist/subinterval of the reference sequence. What's the best way to do that? Example: suffix…
user1819636
1
vote
0 answers

Good open source suffix tree implementation in python or C++

I'm looking for suffix tree implementation having this friendly API that mimics python dictionary: import SubstringDict d = SubstringDict.SubstringDict() d['foobar'] = 1 d['barfoo'] = 2 d['forget'] = 3 d['arfbag'] = 4 d['a'] >>> [1, 2,…
mnowotka
  • 16,430
  • 18
  • 88
  • 134
1
vote
0 answers

String Indexing and Suffix Trees

I have to build some kind of a "string catalogue" out of large PDF documents for faster string/substring searches. The mechanism should work like this: A PDF scanner scans the PDF document for strings and invokes a callback-method in my catalogue to…
Hasib Samad
  • 1,081
  • 1
  • 20
  • 39
1
vote
2 answers

unique substrings using suffix tree

For a given string S of length n- Optimal algorithm for finding all unique substrings of S can't be less than O(n^2). So, the best algorithm will give us the complexity of O(n^2). As per what I have read, this can be implemented by creating suffix…
halkujabra
  • 2,844
  • 3
  • 25
  • 35
1
vote
1 answer

Include a Local Perl Module that References a Local C Library

I want to include a local module in a Perl script that's not installed. The code below seems to work for that purpose. However, the module I want to include is a wrapper for a C library. I do it as follows: use FindBin; use lib…
mstcamus
  • 91
  • 4
1
vote
1 answer

Suffix Tree and Longest Repeated Substring issue

When running the algorithm on the string 'AEKEAAEKEAAEKEA$' looking for the longest substring with at least 3 occurences all the nodes in the suffix tree have maximum 2 branches, how can that be? The correct result should be the substring…
kukit
  • 307
  • 1
  • 3
  • 8
1
vote
1 answer

Longest Repeated Substring Issue

When creating a suffix tree of the string "ABAB" I get only 2 nodes: ABAB and BAB The longest repeatead substring ("AB") should be located by "the deepest node with at least k descendants" but this is not the case with my string, what's wrong…
kukit
  • 307
  • 1
  • 3
  • 8