Address
Whiteland, IN 46184

Work Hours
Monday to Friday: 9AM - 5PM
Weekend: 1PM - 3PM

Tree Data Structure

What is a Tree?

Simply put a tree is a data structure that consists of nodes in a parent/child relationship.
Trees are well-known as a non-linear data structure. They don’t store data in a linear way. They organize data hierarchically. This article is introducing you to the concept of the tree structure before we dive into the binary search tree data structure that is used for storing data for faster search.

TREE TERMINOLOGY

  • Root – The top node in a tree.
  • Child -A node directly connected to another node when moving away from the Root.
  • Parent – The converse notion of a child.
  • Siblings -A group of nodes with the same parent.
  • Leaf – A node with no children.
  • Edge – The connection between one node and another.

KINDS OF TREES

  • Trees
  • Binary Trees
  • Binary Search Trees

How does tree work?
A tree always starts from the root node which is on top of the tree, the node can have any number of children that point downwards from the diagram above. These children can also have children and those children can have children and so on. In binary search trees which we are going to look at in the next article the number of each child is restricted to two (thus the name binary).
Applications Of Trees

  • HTML DOM
  • Network Routing
  • Abstract Syntax Tree
  • Artificial Intelligence
  • Folders in Operating Systems
  • Computer File Systems

 

Written by Okocha Ebube

 
 

Get our Latest Insights right in your Inbox.

Enter your email address below to subscribe to our weekly newsletter.

Leave a Reply

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