public static int Maxlevel = 0;
leftchild = rightchild = null;
public void LeftChild(Node root, int level)
Console.Write("{0},", root.data);
LeftChild(root.leftchild, level + 1);
LeftChild(root.rightchild, level + 1);
public static void Main()
Program program = new Program();
program.tree = new Node(1);
program.tree.leftchild = new Node(2);
program.tree.rightchild = new Node(3);
program.tree.leftchild.rightchild = new Node(4);
program.tree.leftchild.rightchild.rightchild = new Node(5);
program.tree.leftchild.rightchild.rightchild.rightchild = new Node(6);
program.tree.leftchild.rightchild.rightchild.rightchild.rightchild = new Node(7);
program.LeftChild(program.tree, 1);