def _build_McCreight(self, x):
u = self.root<EOL>d = <NUM_LIT:0><EOL>for i in range(len(x)):<EOL><INDENT>while u.depth == d and u._has_transition(x[d+i]):<EOL><INDENT>u = u._get_transition_link(x[d+i])<EOL>d = d + <NUM_LIT:1><EOL>while d < u.depth and x[u.idx + d] == x[i + d]:<EOL><INDENT>d = d + <NUM_LIT:1><EOL><DEDENT><DEDENT>if d < u.depth:<EOL><INDENT>u = self._create_node(x, u, d)<EOL><DEDENT>self._create_leaf(x, i, u, d)<EOL>if not u._get_suffix_link():<EOL><INDENT>self._compute_slink(x, u)<EOL><DEDENT>u = u._get_suffix_link()<EOL>d = d - <NUM_LIT:1><EOL>if d < <NUM_LIT:0>:<EOL><INDENT>d = <NUM_LIT:0><EOL><DEDENT><DEDENT>
Builds a Suffix tree using McCreight O(n) algorithm.

        Algorithm based on:
        McCreight, Edward M. "A space-economical suffix tree construction algorithm." - ACM, 1976.
        Implementation based on:
        UH CS - 58093 String Processing Algorithms Lecture Notes