C# Class RadixTree.Tree

Afficher le fichier Open project: paratechnical/RadixTree Class Usage Examples

Méthodes publiques

Méthode Description
Delete ( string label ) : void

Delete: Delete a string from the tree. First, we delete the corresponding leaf. Then, if its parent only has one child remaining, we delete the parent and merge the two incident edges.

DeleteRec ( string wordPart, Node curNode ) : void

delete a word from the tree means delete the last leaf that makes up the stored word

FindPredecessor ( string word ) : string

Find predecessor: Locates the largest string less than a given string, by lexicographic order.

FindSuccessor ( string word ) : string
Insert ( string word ) : void

insert a word into the tree

Lookup ( string word ) : bool
Tree ( ) : System

construct a new tree with it's root

Private Methods

Méthode Description
FindPredecessorRec ( string wordPart, Node curNode, string carry ) : string

FindSuccessorRec ( string wordPart, Node curNode, string carry ) : string
InsertRec ( string wordPart, Node curNode ) : void

recursively traverse the tree carry the word you want inserted until a proper place for it is found and it can be inserted there if a node already stores a substring of the word(substrnig with the same first letter as the word itself) then that substring must be removed from the word and it's children checked out next hence the name wordPart - part of a word

LookupRec ( string wordPart, Node curNode ) : bool

look for a word in the tree begining at the current node

MatchingConsecutiveCharacters ( string word, Node curNode ) : int

given a string and a node the number of characters that the string and the node's label have in common starting from the first character in each is returned

Method Details

Delete() public méthode

Delete: Delete a string from the tree. First, we delete the corresponding leaf. Then, if its parent only has one child remaining, we delete the parent and merge the two incident edges.
public Delete ( string label ) : void
label string
Résultat void

DeleteRec() public méthode

delete a word from the tree means delete the last leaf that makes up the stored word
public DeleteRec ( string wordPart, Node curNode ) : void
wordPart string
curNode Node
Résultat void

FindPredecessor() public méthode

Find predecessor: Locates the largest string less than a given string, by lexicographic order.
public FindPredecessor ( string word ) : string
word string
Résultat string

FindSuccessor() public méthode

public FindSuccessor ( string word ) : string
word string
Résultat string

Insert() public méthode

insert a word into the tree
public Insert ( string word ) : void
word string
Résultat void

Lookup() public méthode

public Lookup ( string word ) : bool
word string
Résultat bool

Tree() public méthode

construct a new tree with it's root
public Tree ( ) : System
Résultat System