Ternary Tree had some bugs in its printing implementation, like not printing the complete tree (or not printing at all small trees) on some platforms, first-level indentation was wrong (some second-level nodes appeared at the same indentation of the root node), etc.
Also optimized it to use a single StringBuilder instead of creating a whole lot of them, made the code shorter and cleaner, added command line option to print the full path on every line (easier for some analyses, and useful to see full words and not just their suffix), added indication of words ending in the middle of a path (prefix of other words), and changed the chars and spacing to make the printout look more like a standard tree diagram.
This helped me in analysing and understanding later modifications and their effect on the tree structure, correctness and performance.
Ternary Tree had some bugs in its printing implementation, like not printing the complete tree (or not printing at all small trees) on some platforms, first-level indentation was wrong (some second-level nodes appeared at the same indentation of the root node), etc.
Also optimized it to use a single StringBuilder instead of creating a whole lot of them, made the code shorter and cleaner, added command line option to print the full path on every line (easier for some analyses, and useful to see full words and not just their suffix), added indication of words ending in the middle of a path (prefix of other words), and changed the chars and spacing to make the printout look more like a standard tree diagram.
This helped me in analysing and understanding later modifications and their effect on the tree structure, correctness and performance.