programming-examples/java/Collection_API_Problems/ISuffixTree.java

31 lines
960 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
package com.jwetherell.algorithms.data_structures.interfaces;
import java.util.Set;
/**
* In computer science, a suffix tree (also called PAT tree or, in an earlier form, position tree) is a compressed trie
* containing all the suffixes of the given text as their keys and positions in the text as their values. Suffix trees
* allow particularly fast implementations of many important string operations.
*
* http://en.wikipedia.org/wiki/Suffix_tree
*
* @author Justin Wetherell <phishman3579@gmail.com>
*/
public interface ISuffixTree<C extends CharSequence> {
/**
* Does the sub-sequence exist in the suffix tree.
*
* @param sub-sequence to locate in the tree.
* @return True if the sub-sequence exist in the tree.
*/
public boolean doesSubStringExist(C sub);
/**
* Get all the suffixes in the tree.
*
* @return set of suffixes in the tree.
*/
public Set<String> getSuffixes();
}