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
0
votes
1 answer

Pointer issue while implementing suffix tree in c++

I was trying to implement suffix tree using c++ by looking at some examples online. I am running into pointer issue and I am not able to fix it. Any help is greatly appreciated. /* * Implement suffix array to print the maximum suffix substring in a…
sri_84
  • 81
  • 6
0
votes
1 answer

Substring search on HashMap Values

Given a HashMap, I want to retrieve all the entries e whose value contains a given substring s (Non case-sensitive). I am looking for substring index ideas on the lines of Suffix trees (trie) which are suited only for prefix/suffix matches.
0
votes
0 answers

Suffix Array sort function

Here I am trying to use inbuilt sort function. 's' is the array which stores the index. I am trying to sort this array according to suffix strings. If I am using qsort() function it works fine. But as soon as sort() used it sorts simply s array,…
0
votes
1 answer

How to store data in Django cache as a reference rather than value.?

I am using Suffix Tree wrapper for python Programmer. https://hkn.eecs.berkeley.edu/~dyoo/python/suffix_trees/ I need the same instance of Suffix tree every time, a views is called in Django. So, I store the Suffix tree instance in django-cache and…
Nakshatra
  • 663
  • 1
  • 6
  • 14
0
votes
1 answer

Suffix array/suffix tree with numbers

Can suffix trees or suffix arrays be used effectively with numbers? For example: Can it be used with the array [1,2,3,4,5,3,9,8,5,3,9,8,6,4,5,3,9,11,9,8,7,11] to extract all possible non-overlapping repeating sub-strings of all sizes from the…
0
votes
0 answers

c++ - Efficient algorithm to search for matching substrings

Example: I have many patterns like this: sexy hello sex every sex example ... I have a query like this: hello, sexygirl. This query will match the first pattern. Because it contains sexy and hello. Attention: sexy and girl have no blank. Is…
0
votes
1 answer

How can I find such string in linear time using the suffix tree?

Given a string s of length n, find the longest string t that occurs both forwards and backwards in s. e.g, s = yabcxqcbaz, then return t = abc or t = cba I am considering using the generalized suffix tree but I think it would take me O(n^2) time. i…
xxx222
  • 2,980
  • 5
  • 34
  • 53
0
votes
1 answer

Generalized Suffix Tree Java Implementation For Large Datasets

I have a collection of around 50 millions strings, each has around 100 characters. I am looking for very efficient (running time and memory usage) generalized suffix tree implementation. I have tried https://github.com/npgall/concurrent-trees but…
0
votes
0 answers

Suffix trees in matlab

I'm trying to implement an algorithm in matlab which uses a suffix tree to compare strings. I was thus wondering if there is a pre-implemented algortim to make a suffix tree for a certain string (or set of strings)? Or do I have to implement a…
0
votes
2 answers

Root Identification in a list of Data in python:

I am new to Python. I tried to come up with "Root Identification" from the list of data. But it doesn't work. Here is code that I have tried: listData=["blackish", "blacken","blacked"] The output I expect is: root = [black] and suffixLi = ["ish",…
0
votes
1 answer

count number of occurence of each substring?

Given a string S, I want to calculate number of substrings which occurred n times (1 <= n <= s.length()). I have done it with rolling hash, it can be done by using a suffix tree. How can it be solved using a suffix array in complexity O( n^2 )…
rishabh
  • 49
  • 8
0
votes
2 answers

How to construct a suffix Trie for all the substrings of a string?

I want to build a space efficient suffix trie for all the substrings of the string; Suppose the length of the string is 5000, then number of substring would be approx 25*10^6 and for every node i m storing an array of linkd of size 26 so total…
0
votes
2 answers

Fetch Words Starting/Containing/Ending With Fragment in a Word Dictionary

Assuming that we have a list of all dictionary words from A-Z from the English dictionary. I have three cases to perform on these list of words: 1) find out all the words that are "starting with" a particular fragment eg: If my fragment is 'car',…
D3XT3R
  • 181
  • 2
  • 15
0
votes
1 answer

How to get connected neighbour nodes on the same height when drawing in GraphViz?

I'm trying to draw the following (suffix-tree) using GraphViz: digraph G { 1[label = " "]; 2[label = " "]; 3[label = " "]; 4[label = " "]; 5[label = " "]; 6[label = " "]; 7[label = " "]; 8[label = " "]; // edges drawn vertically,…
ShadowGames
  • 1,110
  • 1
  • 10
  • 15
0
votes
1 answer

finite state or suffix tree

I want to create an algorithm that finds substrings inside a string wich exist in an alphabet. For example in a string "abcdefhhhasddasdabbba" i want to find substrings that are spawned by alphabet {'a','b'} So my output will be like: ab ,a…
bill
  • 728
  • 3
  • 6
  • 15