six trees and tree algorithms objectives to understand what tree data structure is and how it is used to see how trees can be used to implement map data structure to implement trees using list to implement trees using classes and references to implement trees as recursive data structure to implement priority queue using heap examples of trees now that we have studied linear data structures like stacks and queues and have some experience with recursionwe will look at common data structure called the tree trees are used in many areas of computer scienceincluding operating systemsgraphicsdatabase systemsand computer networking tree data structures have many things in common with their botanical cousins tree data structure has rootbranchesand leaves the difference between tree in nature and tree in computer science is that tree data structure has its root at the top and its leaves on the bottom notice that you can start at the top of the tree and follow path made of circles and arrows all the way to the bottom at each level of the tree we might ask ourselves question and then follow the path that agrees with our answer for example we might ask"is this animal chordate or an arthropod?if the answer is "chordatethen we follow that path and ask"is this chordate mammal?if notwe are stuck (but only in this simplified examplewhen we are at the mammal level we ask"is this mammal primate or carnivore?we can keep following paths until we get to the very bottom of the tree where we have the common name second property of trees is that all of the children of one node are independent of the children of another node for examplethe genus felis has the children domestica and leo the genus musca also has child named domesticabut it is different node and is independent of the domestica child of felis this means that we can change the node that is the child of musca without affecting the child of felis