trees root figure generic tree figure tree in the tree of figure the root is node has as parent and kland as children each node may have an arbitrary number of childrenpossibly zero nodes with no children are known as leavesthe leaves in the tree above are bchipqklmand nodes with the same parent are siblingsthuskland are all siblings grandparent and grandchild relations can be defined in similar manner path from node to nk is defined as sequence of nodes nk such that ni is the parent of ni+ for < the length of this path is the number of edges on the pathnamelyk there is path of length zero from every node to itself notice that in tree there is exactly one path from the root to each node for any node ni the depth of ni is the length of the unique path from the root to ni thusthe root is at depth the height of ni is the length of the longest path from ni to leaf thus all leaves are at height the height of tree is equal to the height of the root for the tree in figure is at depth and height is at depth and height the height of the tree is the depth of tree is equal to the depth of the deepest leafthis is always equal to the height of the tree if there is path from to then is an ancestor of and is descendant of if  then is proper ancestor of and is proper descendant of implementation of trees one way to implement tree would be to have in each nodebesides its dataa link to each child of the node howeversince the number of children per node can vary so greatly and is not known in advanceit might be infeasible to make the children direct links in the data