Tidy tree drawing Algorithm

The algorith follows three aesthtic rules that are to be considered while tree drawing. In a first post-order walk, every node of the tree is assigned a preliminary x-coordinate(held in a field of x). In addition, internal nodes are given modifier's which will later be used used to movetheir sons right. During a second pre-order walk, each node is a given a final x-coordinate by summing its preliminary x-coordinate and the modifier's of all the node's ancestors. The y-coordinate depends, as before, on the height of the node.

Variables used :

Variables used inside the Structure(tree)

An example case

Right side is the terminal where you input the details, the output is seen in the left side window