C# Класс RadixTree.Tree

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Delete() публичный Метод

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
Результат void

DeleteRec() публичный Метод

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
Результат void

FindPredecessor() публичный Метод

Find predecessor: Locates the largest string less than a given string, by lexicographic order.
public FindPredecessor ( string word ) : string
word string
Результат string

FindSuccessor() публичный Метод

public FindSuccessor ( string word ) : string
word string
Результат string

Insert() публичный Метод

insert a word into the tree
public Insert ( string word ) : void
word string
Результат void

Lookup() публичный Метод

public Lookup ( string word ) : bool
word string
Результат bool

Tree() публичный Метод

construct a new tree with it's root
public Tree ( ) : System
Результат System