Sunday, 16 March 2014

Week 9

    This week, we were assigned our third exercise in the course. In the first part, we had to make a function that takes the pre-order and in-order traversals of a binary search tree and reconstructs the tree. I found that this was kind of tricky at first, but after playing around with it a bit, I was able to figure it out. Recursion is my friend. Recursion is my friend. Recursion is my friend. In the second part, we had to make a function that takes a BST and returns the sum of the nodes along the tree's deepest branch. I am working on this right now - haven't finished yet. I'm trying to figure out how to record and compare each of the tree's branches. Hopefully I'll be able to figure it out by the due date at the end of the day!

No comments:

Post a Comment