# Tag Archives: Suffix-Tree

## Count of distinct substrings of a string using Suffix TrieNovember 30, 2016

Given a string of length n of lowercase alphabet characters, we need to count total number of distinct substrings of this string. Examples: Input :… Read More »

## Overview of Data Structures | Set 3 (Graph, Trie, Segment Tree and Suffix Tree)February 14, 2016

We have discussed below data structures in previous two sets. Set 1 : Overview of Array, Linked List, Queue and Stack. Set 2 : Overview… Read More »

## Suffix Tree Application 6 – Longest Palindromic SubstringDecember 28, 2014

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,… Read More »

## Suffix Tree Application 5 – Longest Common SubstringNovember 18, 2014

Given two strings X and Y, find the Longest Common Substring of X and Y. Naive [O(N*M2)] and Dynamic Programming [O(N*M)] approaches are already discussed… Read More »

## Generalized Suffix Tree 1November 17, 2014

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… Read More »

## Suffix Tree Application 4 – Build Linear Time Suffix ArrayNovember 14, 2014

Given a string, build it’s Suffix Array We have already discussed following two ways of building suffix array: Naive O(n2Logn) algorithm Enhanced O(nLogn) algorithm Please… Read More »

## Suffix Tree Application 3 – Longest Repeated Substring

Given a text string, find Longest Repeated Substring in the text. If there are more than one Longest Repeated Substrings, get any one of them.… Read More »

## Suffix Tree Application 2 – Searching All PatternsNovember 13, 2014

Given a text string and a pattern string, find all occurrences of the pattern in string. Few pattern searching algorithms (KMP, Rabin-Karp, Naive Algorithm, Finite… Read More »

## Suffix Tree Application 1 – Substring CheckNovember 8, 2014

Given a text string and a pattern string, check if pattern exists in text or not. Few pattern searching algorithms (KMP, Rabin-Karp, Naive Algorithm, Finite… Read More »