title: To check wether it's a complete binary tree or fully binary tree or neither of the two
body: <p>I am new with the concept if binary trees. I have been stuck at a question for many days. It is to find if a given tree is a binary tree or a fully binary tree or neither of the two.</p>
  
  <p>I have thought of many algorithm but none of them fulfill each and every case.
  I tried google but there was no proper solution.</p>
  
  <p>I thought of using Level Order Traversal Technique but couldn't come up with how to know thier levels after all the nodes have been inserted in the queue.</p>
  
  <p>For the Fully Binary tree I tried counting if the degree of all the nodes are 0 or 2 but then if the tree has some intermediate node with degree this logic is also wrong.</p>
  
  <p>I have made a tree using a linked list, The basic - Left Child, Right Child Relationship way.</p>
  
  <p>For the fully binary tree I do a inorder traverl and checked the degree if 0 or 2, but it's wrong cause if there's a node at some earlier level with degree 0 then also then output comes true.</p>
  
  <p>For the complete binary tree i couldn't come up with anything proper.</p>
  
  <p>Thank You.</p>
  
  <p>And I am using C++, so if the logic uses pointers then it's alright.</p>