Week 6 – recursive structures
Something
that I encountered in lectures this week was trees, it was completely new to
me. The name tree comes exactly from the tree out there in nature. The trees
can grow and shrink. There are roots, branches and leafs. You can only reach a
leaf with one unique path. There is only one node in each tree and it is
distinguished as root. Each non-root node has only one parent. You can
calculate the height of the tree and branching factor of the tree. In class we
did many examples with trees using recursion, such as: summing up the number of
nodes in the tree, height of this tree, leaves and the branching factor. I
enjoyed learning about trees, it gave me new insight on structuring data sets.
I understand the majority about trees but there are some areas where I lack. I’ll
be going over it during the reading week to gain a much better understanding
where I lack. My confidence about trees is high, I feel like I understand the
concept and where I could apply it. Now when I see trees outside, I’ll be
thinking of trees in computer language.
This
week in the lab we worked on recreating given functions without using certain
methods. It was a challenging lab but fun at the same time. We also did some
unit testing, something that takes up a lot of time, I think. The hardest part
of the lab was Pythagorean triples. We had to find every combination for Pythagorean’s
triangle given the hypotenuse. It felt like an achievement once my lab partner
and I finished it.
Assignment
one was due on Thursday. I was able to complete it all including the bonus. It
felt like my biggest programming achievement to date. The biggest issue I had
was with the recursive step. It took me a few hours to complete with my
partner. Eventually we got it and moved on after a tiny celebration. We tested
for an hour to ensure everything was working properly and we improved our
docstrings.
No comments:
Post a Comment