Me and my partner finally finished A1 couple of hours before the deadline. We were for most part successful in implementing recursion, although the formula given on handout proved too challenging to apply, we were able to get optimal value using recursion up to 10 cheeses.
During reading week i have been catching up on 148 stuff i missed and preparing for the midterm. I will talk a little bit about binary trees. We have so far in class discussed binary tree and its methods like data storing, nested lists etc. A binary tree does use alot of recursion. Binary tree is made of nodes, where nodes have a right and left parts. Trees have an important part in programming as it can make coding easier with its properties of organizing elements and inheritance, which means that any subtree of a tree and a similar structure hence it makes writing the recursive coding easier. A binary tree can also be helpful in solving binary search problems i.e. when you insert an item in a tree it gets compared to the item in root which then places it in the right or left subtree recursively, hence simplifying the search problem.
No comments:
Post a Comment