Tag Archives: Suffix-Tree

Suffix Tree Application 6 – Longest Palindromic Substring

Given a string, find the longest substring which is palindrome. We have already discussed Naïve [O(n3)], quadratic [O(n2)] and linear [O(n)] approaches in Set 1, Set 2 and Manacher’s Algorithm. In this article, we will discuss another linear time approach based on suffix tree. If given string is S, then approach is following: Reverse the… Read More »

Generalized Suffix Tree 1

In earlier suffix tree articles, we created suffix tree for one string and then we queried that tree for substring check, searching all patterns, longest repeated substring and built suffix array (All linear time operations). There are lots of other problems where multiple strings are involved. e.g. pattern searching in a text file or dictionary,… Read More »