Data Structure

Tree Structure

What is Tree Structure?

Before I am going to start what is Index in SQL server. I would like to explain what the Binary tree topic is here. But it’s important to know what the Binary tree is before understanding the Index in SQL
Let go…!

Basically, three are used to represent the data objects in a hierarchical manner, to do fast search whatever we need.

The figure represent the Tree Structure for any company
Based on the above example, we can categories three-part as Root, Intermediate, and Leaf node

Based on the above relationship you can understand how relationships are managed in an organized, these nodes can be either leaf nodes or parents’ nodes.

Below are some of the binary tree examples

Basic Terminologies in Tree Structures.

  • The root is a unique node in the tree structure to which further subtrees are attached. For the above example Organization is the Root node here.
  • Sub Trees: Sub Trees are referring to the Root note and it has a child Node, maybe the root note has one child or two children.
  • Parent Node: The node having the further sub-branches is called parent Node. For the able example Client, Employee is parent nodes.
  • Child Node: Which is node referring to Parent’s node is called Child Node, for the above example International, National, Manager, and Senior Managers are child Nodes.
  • Leaves: Terminal nodes of the binary tree called Leaves.
  • Degree of the Node: Total no of nodes attached to Child nodes is called the degree of the nodes.
  • Degree of the tree: Maximum degree in the three is called the degree of the tree.
  • Level of the tree: Frist root node always calling as level Zero, the advancement of the nodes to root is supposed to be at Level 1, and so on.
  • Height of the tree: Maximum level is the height of the tree.
  • Predecessor: When a node occurs before some other node then is called Predecessor. (Ex: if you read 20 first and then if you read 30, here 20 is Predecessor of 30 )
  • Successor: A successor is a node that comes again next to some node.
    Ex: if you want to read 30 nodes after reading 60, here 30 nodes is the successor
  • Sibling: When the node with common Parents are called siblings or brothers

Comments are Closed

Prabhakaran Jayaraman