Task is to store an array of integers in a ternary search tree. Each element of the array can take one of the three values: 0, 1 or 2.
The C/C++ code is available on my GITLAB page. The resulting tree could be plotted using Graphviz software using a dot file. This code also contains code for generating a dot file. Once the dot file is obtained. Use the following command to generate the tree as shown below:
$ dot -Tps tst_data.dot -o tst_data.ps
$ gv tst_data.ps
The C/C++ code is available on my GITLAB page. The resulting tree could be plotted using Graphviz software using a dot file. This code also contains code for generating a dot file. Once the dot file is obtained. Use the following command to generate the tree as shown below:
$ dot -Tps tst_data.dot -o tst_data.ps
$ gv tst_data.ps