Then, as stated above, what substring can be found in O (m)?
Inaction. You are right that the search execution time in the suffix trees is more complicated than just O (m).
, O (m), : node O (1), , (, ), .
, , ++ , (char) 256 . node :
struct node {
char current_character;
node* children[256];
};
current_character , node, children - . , node u, c. node :
node* next = u->children[c];
if (next == 0) {
// Child node does not exist => nothing found.
}
else {
u = next;
// Continue search with next …
}
, (, ). , O (m).