Welcome to Brannon's Reading Notes!

This serves as my personal page to keep and update my reading notes for Code Fellows Courses 201, 301, and 401.

Reading 15

Anatomy of a Binary Tree

A binary tree is a collection of nodes organized in branching child nodes. The max number of children a node can have is determined by the value of K. In binary trees, this value is k=2. The final nodes containing no children are known as leaf nodes.

image

As you can see in the above image, the root node has two children, a left and right child. Those children each may have a left and right child as well. The connection between each node is called an edge.

Traversal of a Tree

Two methods may be used when traversing a tree:

Let’s Examine the Depth First Method (Stack Method)

Within the depth method, three different orders may be taken when stepping through the nodes, as seen here:

image