Skip to content

T_CodeJam_Collections_SuffixTree

Andrew Koryavchenko edited this page Jul 4, 2017 · 2 revisions

SuffixTree Class

Implementation of the suffix tree with Ukkonen's algorithm

Remarks

See http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english/9513423 and http://www.cise.ufl.edu/~sahni/dsaaj/enrich/c16/suffix.htm

Inheritance Hierarchy

System.Object
  CodeJam.Collections.SuffixTreeBase
    CodeJam.Collections.SuffixTree
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 1.1.0.0 (1.1.0.0)

Syntax

C#

public class SuffixTree : SuffixTreeBase

VB

Public Class SuffixTree
	Inherits SuffixTreeBase

F#

type SuffixTree =  
    class
        inherit SuffixTreeBase
    end

The SuffixTree type exposes the following members.

Constructors

 

Name Description
Public method SuffixTree Creates instance of SuffixTree.
  Back to Top

Properties

 

Name Description
Protected property EdgeComparer The comparer to compare edges of a node against a char (Inherited from SuffixTreeBase.)
Protected property InternalData Concatenated input strings (Inherited from SuffixTreeBase.)
Protected property NodesCount Number of nodes (Inherited from SuffixTreeBase.)
Protected property Root The root node (Inherited from SuffixTreeBase.)
Protected property StringLocations List of locatons of added strings inside the InternalData (Inherited from SuffixTreeBase.)
  Back to Top

Methods

 

Name Description
Public method Add Adds a new string to the tree (Inherited from SuffixTreeBase.)
Protected method AddNode Adds a new node (Inherited from SuffixTreeBase.)
Public method All Enumerates all suffixes in the suffix tree (Inherited from SuffixTreeBase.)
Protected method AppendNodeText Appends specified node text. (Overrides SuffixTreeBase.AppendNodeText(StringBuilder, Int32).)
Protected method BuildFor Appends suffixes for the last added string (Overrides SuffixTreeBase.BuildFor(Int32, Int32).)
Public method Compact Releases internal structures used only for tree building to free some memory
Public method Contains Checks wether the suffix tree contains the given substring or not (Inherited from SuffixTreeBase.)
Public method ContainsSuffix Checks wether the suffix tree contains the given suffix or not (Inherited from SuffixTreeBase.)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Protected method GetNode Gets a node at the index (Inherited from SuffixTreeBase.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Print Prints the tree structure to the string for the debugging purposes (Inherited from SuffixTreeBase.)
Public method StartingWith Enumerates all suffixes starting with the given prefix (Inherited from SuffixTreeBase.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method UpdateNode Updates the node at the index (Inherited from SuffixTreeBase.)
  Back to Top

Fields

 

Name Description
Protected fieldStatic member InvalidNodeIndex Unassigned node index
  Back to Top

See Also

Reference

CodeJam.Collections Namespace

Clone this wiki locally