I want to print tree, which contains in a List<Node>
. Anybody help me
Class Node has 4 fields:
public char Symbol { get; set; }
public int Frequency { get; set; }
public Node Right { get; set; }
public Node Left { get; set; }
I want to print tree, which contains in a List<Node>
. Anybody help me
Class Node has 4 fields:
public char Symbol { get; set; }
public int Frequency { get; set; }
public Node Right { get; set; }
public Node Left { get; set; }
you need to tell us Breadth first or Depth first ? or some other ways to traversal the tree
Someone has already provide the solution of Breadth first here
https://github.com/AharonSambol/PrettyPrintTreeCSharp
I know I'm late.. But I made this solution which works not only for simple trees but also for more complex ones (such as multi-lined strings)
Example output: