Thursday, 13 February 2014

Recursive Tree Lists

This week we mainly discussed tree methods that work with the trees. I previously worked with search list in the labs which i understood and was able to complete but the tree list was like maybe 10 steps ahead of that. We learned that a leaf is a node with no children and a root is parent with no parents and a child could be a tree but all the last nodes are children. We than learned about post order and in order traversals which are two different ways of representing the nodes in a tree.
We did a lot of recursive functions in class that were fairly similar but accomplished different thing.
We worked with list comprehension in a lot of the function while working with tree lists.
In comp sci, a binary tree is a tree data structure in where each root can have a max of 2 children. The children ar In a binary tree, the degree of each node can be at most two. Binary trees are used to implement binary search trees and binary heaps, and are used for efficient searching and sorting. A binary tree is a special case of a K-ary tree, where k is 2.



No comments:

Post a Comment