Interface IConverter
A converter between different ISuffixStructureNode<TEdge, TNode> structures, such as SuffixTrieNode and SuffixTreeNode.
Namespace: MoreStructures.SuffixStructures.Conversions
Assembly: MoreStructures.dll
Syntax
public interface IConverter
Methods
| Improve this Doc View SourceTreeToTrie(SuffixTreeNode)
Converts the provided SuffixTreeNode instance into an equivalent instance of SuffixTrieNode, building its entire structure.
Declaration
SuffixTrieNode TreeToTrie(SuffixTreeNode treeNode)
Parameters
Type | Name | Description |
---|---|---|
SuffixTreeNode | treeNode | The node identifying the trie structure to be converted. |
Returns
Type | Description |
---|---|
SuffixTrieNode | A trie, equivalent to the provided tree. |
Remarks
COMPLEXITY
Time Complexity = O(n^2) and Space Complexity = O(n^2) where n = number of nodes in the input structure.
Each node of the input tree is visited at most twice.
However, expansion increase the number of nodes, in the worst case to the number of characters in all
suffixes of the text which has generated the tree.
TrieToTree(SuffixTrieNode)
Converts the provided SuffixTrieNode instance into an equivalent instance of SuffixTreeNode, building its entire structure.
Declaration
SuffixTreeNode TrieToTree(SuffixTrieNode trieNode)
Parameters
Type | Name | Description |
---|---|---|
SuffixTrieNode | trieNode | The node identifying the trie structure to be converted. |
Returns
Type | Description |
---|---|
SuffixTreeNode | A tree, equivalent to the provided trie. |
Remarks
COMPLEXITY
Time Complexity = O(n) and Space Complexity = O(n) where n = number of nodes in the input structure.
Each node of the input trie is visited at most twice and coalescing reduces the number of nodes.