 |
| (This is a tree) |
Hello fellow
pythonista! Week 6 was full of challenges and fun, while our heads ached from A1.
This week's slides focused once more on recursion. As the weeks go by, I start to worry more about writing recursive code on the
midterm, but I'll leave those thoughts for reading week. Usually I would look at the slides and panic but this week's weren't as
frightening! We talked mostly about terminology of recursive structures. For instance, Heap showed us this example called a
tree which contain nodes, with one parent, that can be in a sequence by following paths. There are other terms including height, being the maximum path length of the tree, and leaves which are nodes without children, but I wont name them all. Following this explanation of
trees, we went through tree traversal! We learned about pre-order, in-order, and post-order traversal, which I'll have to study a bit. So far they look like ways of sorting values in a tree, regarding their height and location. The remaining parts of the Wednesday's lecture focused on methods that could be implemented on a Tree class, such as __repr__, sum, and height.
This week's lab was super
easy! It required us to understand built-in methods such as all, any, filter, etc., but didn't require us to use them at all; we only had to break them down. Thus, we finished early and I gave myself a pat on the back. One extra thing it familiarized me with was test cases. Every time I saw that we had to make test cases, I cringed, but I feel like I can do them now.
One huge topic among 148 students this week was A1. I spent hours doing it, and I'm proud for finishing it as well as I could, but getting there was a long progress. I spent a lot of time looking at the handout for step 5, and though I couldn't get the best number of moves for all number, I think I got them close enough to get a good amount of credit. Anyways, that's all I have to say for this week.
See
y'all after reading week!
I agree with what you said about the lab this week being easy! I also left really early!
ReplyDeleteAs for A1, I spent so long trying to find the best possible method. Eventually, I actually did manage to find it, which was a big relief!
Good luck studying!