binary trees we have introduced and used several sequential structures throughout the text such as the arraypython listlinked liststacksand queues these structures organize data in linear fashion in which the data elements have "beforeand "afterrelationship they work well with many types of problemsbut some problems require data to be organized in nonlinear fashion in this we explore the tree data structurewhich can be used to arrange data in hierarchical order trees can be used to solve many different problemsincluding those encountered in data miningdatabase systemsencryptionartificial intelligencecomputer graphicsand operating systems the tree structure tree structure consists of nodes and edges that organize data in hierarchical fashion the relationships between data elements in tree are similar to those of family tree"child,"parent,"ancestor,etc the data elements are stored in nodes and pairs of nodes are connected by edges the edges represent the relationship between the nodes that are linked with arrows or directed edges to form hierarchical structure resembling an upside-down tree complete with branchesleavesand even root formallywe can define tree as set of nodes that either is empty or has node called the root that is connected by edges to zero or more subtrees to form hierarchical structure each subtree is itself by definition tree classic example of tree structure is the representation of directories and subdirectories in file system the top tree in figure illustrates the hierarchical nature of student' home directory in the unix file system trees can be used to represent structured datawhich results in the subdivision of data into smaller and smaller parts simple example of this use is the division of book into its various parts of sectionsand subsectionsas illustrated by the