Basic Terminology of Tree

  • Root is at the top of the tree
  • Each node except the root has exactly one node above it which is called its parent
  • Nodes directly below a node are called its children
  • Root does not have a parent; but each one of the other nodes has a parent node associated to it
  • A node may or may not have children.


  1. A node that has no children is called a Leaf node
  2. A line from a parent to a child node is called a branch or an edge
  3. If the tree has n nodes, one of which is the root then there would be n-1 branches



It is a list of distinct vertices in which successive vertices are connected by edges in the tree
There is exactly one path between the root and some node
When there is no path between the root and some node, we get a GRAPH not a TREE.
Root does not have a parent; but each node associated with it has a parent node associated to it
A node may or may not have children
A node without children is called a leaf node
Nodes with at least one child is sometimes called non terminal nodes
Non terminal nodes – Internal nodes
Terminal nodes – External nodes
Ex. B,C,E,H,I,K,L,M are leaf nodes

Length of Path:
It is the number of branches on the path
If there is a path from node “n” to node “i”, then “n” is ancestor of “i”
There is a path of length zero from every node to itself
There is exactly one path from the root to each node

Related Links :

No comments:

Post a Comment


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!