Hi, everyone!
In this week lectures, we covered the binary tree and an introduction for time complexity.
I think exercise 3 and lab were both big challenges for me. First about the E3, it really took me a long time to figure it out. And I don't think I can work it out alone without some outside help. Part A is fine and not so hard, but part b is, eh..quite a challenge. It would not be overstated that it should be the most difficult recursive function I've ever written. I was struggle how to store the height of the node along with the sum until my friend suggested to use tuple, which I would never come up by myself.
Lab was difficult mostly because we were asked to write recursive method. And it is new for us to write a helper function inside a class method. By I am still wondering the necessity to have a helper function inside.
I think the hint for E3 is helpful. The helper function is where the recursion is.
回复删除The second part of exercise 3 was a big challenges for me.
回复删除