

Depth: The distance that a node is from the root node.That node and all of the nodes below it is a sub-tree. Sub-tree: A sub-tree is a section of the main tree.Here are a few more key terms that are helpful for when talking about trees. Finally, nodes B, D, E, and F are leaf nodes as they do not have any child nodes. They are sibling nodes because they both have node C as a parent.

Nodes B, C, and D share the same parent node A. Node C is a parent node to child nodes E and F. A is also the parent node to child nodes B, C, and D. Using the above figure, let’s go over some of these terms that we have just learned.

Non-linear data structures are not organized sequentially like linear data structures are, so it only makes sense that they have to be traversed non-sequentially.ĭon’t worry though. They are only able to be traversed sequentially. Arrays and linked lists are linear data structures. In my previous post I discussed arrays and linked lists. There are certainly some differences between the two though. Trees are similar to linked lists in that they are made up of nodes and links.
