Friday, 6 March 2015

Trees ADT



Hi everybody! This week in class, we learnt about Abstract Trees Data Types or ADT. Trees Abstract Data Types are a method of organizing data in Computer Science. Using a Tree ADT class, the data is organized into multiple nodes, with the first node named the root. A root may have none to multiple children. Each of these children is also known as a node, and each of the children may have none to multiple children themselves. If a node had no children, it is known as a leaf. On the other hand, a node with one or more children is known as an internal node. The arity or branching factor of a node is the maximum number of children any node can have. Furthermore, an edge connects a parent node to a child. Essentially, each Tree ADT maybe divided into multiple smaller Tree ADTs or subtrees, with each child being considered the root of a subsequent smaller tree. The length of a Tree ADT is the number of edges on it and the path of a tree is a sequence of nodes, which are all interconnected by edges.  The height of a tree is the maximum path length plus one. Lastly, the depth of a node is the height of the whole tree minus the height of the sub tree rooted at that node.
The following diagram may help visualize the concept of Tree ADTs. 




It may be concluded that Trees may prove extremely helpful in representing hierarchy. Furthermore, it maybe deduced that recursion plays a major role in traversing Trees ADT.

Although I believe that I understand Trees ADT pretty well one of the topics I find pretty complicated is the concept of traversing trees. I have found the lab and in-class worksheets pretty useful in helping me deal with the issue, however, I believe I would require more practice in this topic.

Well, this is all for this week, please check out the linked blogs for more information on Trees ADT!


No comments:

Post a Comment