Binary Tree Bootcamp Full Complete & Perfect Trees Preorder Inorder & Postorder Traversal by Back To Back SWE

What is a full binary tree?
A full binary tree is a binary tree where each node has either two children or no children.

Example of a full binary tree
A
B
C
D
E
F
G

What is a complete binary tree?
A complete binary tree is a binary tree where nodes are added from left child to the right child and from the top of the tree to the bottom.

Example of a complete binary tree
A
B
C
D
E
F
G
H
I

What is a perfect binary tree?
A perfect binary tree is a tree where all of the leaves are on the same level and the nodes that do have children have two.

Example of a perfect binary tree
A
B
C
D
E
F
G

What are the three binary tree traversals?
The three binary tree traversals are:

  1. Preorder - Node, then left subtree, then right subtree (NLR).
  2. Inorder - Left subtree, then node, then right subtree (LNR)
  3. Postorder - Left subtree, then right subtree, then node (LRN).

How is a traversal executed?
A traversal is executed recursively.

How is a traversal executed recursively?
A traversal is executed recursively by executing it for every node in the tree.

...