title: C# Creating a TreeView from a Binary Search Tree
body: <p>So, I have a binary search tree, which is populated with strings and has the following structure:</p>
  
  <pre><code>class Node
      {
          public string data;
          public Node left { get; set; }
          public Node right { get; set; }
  
          public Node(string data)
          {
              this.data = data;
          }
      }
      class Tree
      {
          public Node root;
          public Tree()
          {
              root = null;
          }
          public void insert(string data, TreeView view)
          {
              Node newItem = new Node(data); 
              if (root == null)
              {
                  root = newItem;
                  view.Nodes.Add("Root: " + root.data);
              }
              else
              {
                  TreeNode sub = new TreeNode();
                  Node current = root;
                  Node parent = null;
                  while (current != null)
                  {
                      parent = current;
                      if (String.Compare(data, current.data) &lt; 0)
                      {
                          current = current.left;    
                          if (current == null)
                          {
                              parent.left = newItem;
                          }
                      }
                      else
                      {
                          current = current.right;
                          if (current == null)
                          {
                              parent.right = newItem;     
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>Using <code>view.Nodes.Add("Root: " + root.data);</code>, I successfully added the root element but I'm not really sure how to add the other child nodes, so as the structure of the tree view is the same as the binary tree. 
  I need to achieve something like this in the TreeView: </p>
  
  <pre><code>- Root: computer
  - - Left: code
  - - - Left: analyzing
  - - - - Right: and
  - - - Right: cooler
  - - Right: programming
  </code></pre>