Learn Simpli

Free Online Tutorial For Programmers, Contains a Solution For Question in Programming. Quizzes and Practice / Company / Test interview Questions.

 

Tree

data structure - tree

What is a tree?

  1. A tree is a data structure that represents hierarchical data
  2. The nodes in the tree have a 1:N parent-child relationship
  3. Every tree has a root node
  4. A root node is a point where the tree begins
  5. Leaves are outer boundary
Where are tree used?
  1. To manage file system in the operating system
  2. To implement indexing in databases
  3. In router algorithms
  4. In compilers
  5. In computer networking
Properties of trees
  1. Every node has exactly one tree, except the root node
  2. The root node has a zero node
  3. Tree spawns zero or more children
  4. The tree has a limit on children which is called degree of a tree
  5. Leaf nodes have no children
  6. One data item per node