Sunday, 16 March 2014

Week 9: Just a Bit of Binary

This week in both the lectures and the lab I attended we were taught the concept of run times as well as binary search trees. A traversal of a tree is when you express a tree in terms of a sort of list, where there are many types such as pre-order and in-order traversals. These traversals are each unique in that independently they do not tell us that much information but for example with both a pre-order traversal and in-order traversal, we are able to accurately replicate the binary tree of the traversals. I had trouble grasping the idea of how the pre-order and in-order traversal incorporated together to create the binary search tree, but adhering to the advice on Exercise and practicing on various trees of different degrees of size and cases, I was able to find out a base case and ultimately solve the problem of recursively creating the binary tree from the pre-order and in-order traversals. We also briefly covered run time in terms of big O notation, this means that the run time is relative and can be compared to different machines that may run at different speeds relative to others as we only take the highest exponent which has to greatest impact on the runtime.

No comments:

Post a Comment