3 ms·
It is a tree, where the leaves are substrings, and the nodes are the sum of the lengths of all the leaves under the node. Thus, the root node has a value equal
by samatman 13y ago
It is a tree, where the leaves are substrings, and the nodes are the sum of the lengths of all the leaves under the node.
Thus, the root node has a value equal to the length of the string; it has two child nodes, with values equal to the lengths of the first and second 'half' of the string, and so on.