메소드 | 설명 | |
---|---|---|
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, |
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, |
|
|
FindSuccessorRec ( string wordPart, |
||
InsertRec ( string wordPart, |
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, |
look for a word in the tree begining at the current node
|
|
MatchingConsecutiveCharacters ( string word, |
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
|
public DeleteRec ( string wordPart, |
||
wordPart | string | |
curNode | ||
리턴 | void |