trees in computer sciencea tree is very general and powerful data structure that resembles real tree it consists of an ordered set of linked nodes in connected graphin which each node has at most one parent nodeand zero or more children nodes with specific order general specification of trees generallywe can specify tree as consisting of nodes (also called vertices or pointsand edges (also called linesorin order to stress the directednessarcswith tree-like structure it is usually easiest to represent trees pictoriallyso we shall frequently do that simple example is given in figure figure example of tree more formallya tree can be defined as either the empty treeor node with list of successor trees nodes are usuallythough not alwayslabelled with data item (such as number or search keywe will refer to the label of node as its value in our exampleswe will generally use nodes labelled by integersbut one could just as easily choose something elsee strings of characters in order to talk rigorously about treesit is convenient to have some terminologythere always has to be unique 'top levelnode known as the root in figure this is the node labelled with it is important to note thatin computer sciencetrees are normally displayed upside-downwith the root forming the top level thengiven nodeevery node on the next level 'down'that is connected to the given node via branchis child of that node in