title: Creating a Boolean Binary Tree
body: <p>I need to initialize a binary search tree to have all false values.  I am given the height.  First time trying to create a tree.  All the examples I can find typically don't have boolean values.  I am not getting errors but I am in an infinite loop right now.  I'm going to guess that the error is most likely creating the new nodes :/</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class type&gt;
  struct binTreeNode {
      bool value;
      binTreeNode &lt;bool&gt; *left,*right;
  };
  
  void createTree(int height){
      binTreeNode &lt;bool&gt; *root;
      root = new binTreeNode &lt;bool&gt;;
      root -&gt; value = false;
  
      int copyHeight = height;
      copyHeight=copyHeight-1; //Because
      //Created Root already?
  
      while(copyHeight&gt;0){
          root-&gt;left = new binTreeNode &lt;bool&gt;;
          root-&gt;right = new binTreeNode &lt;bool&gt;;
          binTreeNode &lt;bool&gt; *it;
  
          it = root-&gt;left;
          it -&gt; value= false;
  
          it = root-&gt;right;
          it -&gt; value= false;
          copyHeight--;
      }
  };
  </code></pre>