January 2018
Intermediate to advanced
332 pages
7h 36m
English
Let's put our knowledge to use in an example in which our user wants to add two elements to this tree, Adam, and Adrian. First, we will add Adam to the tree so we have nodes a, d, a, and m. Then, when adding Adrian, we check what is already added—a and d, in this case—and thus the rest of the word rian is added as a new subtree.
When logged, the following is what we see:

As you can see from the preceding screenshot, a and d are common for both the words and then the rest are two subtrees for each string that we added.
Read now
Unlock full access