General vs. Strict Binary Tree

General Binary Tree vs. Strict Binary Tree:

In this article, we will learn about General Binary Tree vs. Strict Binary Tree. Please read our previous article discussing Internal Nodes VS External Nodes in a Binary Tree. Strict binary trees are also known as proper binary trees, and sometimes, they are referred to as complete binary trees. 

General Binary Tree vs. Strict Binary Tree:

General Binary Tree: A general binary tree has no specific constraints on a node’s number of children other than the basic rule that each node can have at most two children, i.e., {0, 1, 2}.

Properties:
  • Each node can have zero, one, or two children.
  • The structure is flexible and can vary widely.
  • There is no specific requirement for the arrangement or number of nodes.

Strict Binary Tree (also known as Complete Binary Tree): A strict binary tree, also known as a full binary tree, is a type of binary tree where every node has either zero or exactly two children, i.e., {0, 2}.

Properties:
  • Each node has either two children or none (leaf nodes).
  • The structure is more rigid compared to a general binary tree.
  • If a node has one child, it must also have the other child (i.e., no nodes with only one child).

Now, let’s look at some examples and identify which binary trees are strict binary trees.

General Binary Tree vs. Strict Binary Tree

In this example, three nodes have exactly two child nodes, i.e., degree (2) = 3, and 4 nodes have 0 child nodes, i.e., degree (0) = 4. This is a strict binary tree.

General Binary Tree vs. Strict Binary Tree

In this tree, two nodes have exactly two child nodes, i.e., degree (2) = 2, and 3 nodes have 0 child nodes, i.e., degree (0) = 3. This is a strict binary tree.

General Binary Tree vs. Strict Binary Tree

In this tree, two nodes have exactly two child nodes, i.e., degree (2) = 2, and 3 nodes have 0 child nodes, i.e., degree (0) = 3, but 1 node has one child, i.e., degree (1) = 1. Since a degree of 1 isn’t allowed in a strict binary tree, it is not a strict binary tree but a general binary tree.

General Binary Tree vs. Strict Binary Tree

In this tree, three nodes have exactly two child nodes, i.e., degree (2) = 3, and 4 nodes have 0 child nodes, i.e., degree (0) = 4, but 2 nodes have one child, i.e., degree (1) = 2. So, this is not a strict binary tree but a general binary tree.

General Binary Tree vs. Strict Binary Tree

In this tree, the root node has three child nodes, i.e., degree (3) = 1. Since a strict binary tree can have only 0 or 2 children, this is not a strict binary tree and not even a general binary tree, as binary trees can have at most two child nodes.

General Binary Tree vs. Strict Binary Tree

In this tree, three nodes have only one child node, i.e., degree (1) = 3. So, this is not a strict binary tree. We’ve seen six examples, and only 2 of them are strict binary trees.

In the next article, I will discuss General Binary Tree vs. Strict Binary Tree in C Language with Examples. In this article, I explain General Binary Tree vs. Strict Binary Tree in C Language with Examples. I hope you enjoy this article, General Binary Tree vs. Strict Binary Tree.

Leave a Reply

Your email address will not be published. Required fields are marked *