Tree is a data structures are used to store info in hierarchical order. Each record in a tree is called node. The top most node which has no parent is called root node. Each node has either no child or one or more children. A node which has no child is the outer most node and also known as leaf node.
This is the general Tree node data structure in C -
Example 1: This is very useful data structure to deal with hierarchical records. Most of the time GUI objects are designed with this type of data structure. In GUI every object or node is called window. Like a message box for example has three child items – one text field, two buttons OK and Cancel. Now we take message dialog box as the parent node. Then it has a child text field. This child has sibling as ok button. Again ok button has a sibling as cancel button. At last cancel button is the last child of the dialog this it has no sibling or its sibling is NULL. Here every child item of dialog box has no further child. Thus for each item child is NULL.