title: add unary operator in expression tree
body: <p>I am doing my assignment in which I have to modify my previous task (which is prefix expression tree which takes expression and give result)</p>
  
  <pre><code>+ OR
  * AND
  - NOT
  </code></pre>
  
  <p>Now I have to make it Logic expression tree which will perform AND OR and NOT operations</p>
  
  <pre><code>char input;
      cin.get(input);
  
      if((input == '+')||(input == '-')||(input == '*'))
          {
          p = new ExprTreeNode(input,NULL,NULL);
           buildSub(p-&gt;left);
           buildSub(p-&gt;right);
        }
        else if(isdigit(input))
          {     //create a new node
              p = new ExprTreeNode(input,NULL,NULL);
          }
          else
        {
          cout &lt;&lt;" invalid expression exiting..." &lt;&lt;endl;
           exit (1);
         }
  </code></pre>
  
  <p>above code reads expression and makes tree using recursion...</p>
  
  <p>I am confused how I can add unary operator that is NOT... 
  after that I have to evaluate expression</p>
  
  <pre><code>int answer;
      switch (p-&gt;dataItem){
  
          case '*':
              // AND
          case'+':
              // OR
  
          case '-':
              // Reverse
  
          default:
              answer = (p-&gt;dataItem-'0');
              break;
      }
      return answer;
  </code></pre>
  
  <p>p is ExprTreeNode</p>
  
  <pre><code>// Data members
          char dataItem;          // Expression tree data item
          ExprTreeNode *left,     // Pointer to the left child
                       *right;    // Pointer to the right child
  </code></pre>