No, not the kind you see outside.
Trees, in the scope of programming vernacular, refer to fractal structures with a root at the top, from which come branchlike structures called 'edges' which lead to further 'nodes'. These nodes are anthropomorphized as 'parents' and 'children'; a parent node is one from which other child nodes stem. Though in the midst of lectures I caught myself ruminating on the thoughts and feelings of childless nodes and the parentless root node, I still wasn't quite sure what purpose these tree serves, other than being fodder for daydreams.
As it later became apparent, trees are useful structures for representing multidimensional lists in a comprehensible form. These trees can be traversed in various ways so that each node in the tree can be accessed in various sequences.
Though we have yet to be taught the applications of trees, their mere structures suggests that they will be useful in list searching and list indexing. For instance, finding the nth element in a flat list requires going through n - 1 elements, a number which would be significantly lower were the desired element located in a branched tree.
No comments:
Post a Comment