Hello,
I tried to search this solution in the forum, and I see people asking and replying with solutions to similar situation, but I don't get what I am looking for. Also because I have never tried with graphs before.
So, my problem is, I need a function that takes a string with tree structure, as in automata or tree graph, and displays the nodes in tree form. "Tree" is not important, but important is that each object should be displayed as a node and lines connecting them. Please see the image below (with three possible options):
So, basically, the tree structure could be like X(a, X(a,b), c) where X(a,b) is a sub-tree of higher level X. The program knows the parent-child relationship, so this function only needs to display those elements in a graphical fashion.
I pass the string in the form of a 2D array showing the hierarchy (to simplify).
In the image, I am showing three possible options for showing the tree. The third option eliminates those circles and rectangles, if that simplifies.
I hope I explained clearly.
Thanks ahead!