Week 8
We are dealing with the 'LinkedList' now. It is quite different from other classes we've learnt before. It links a LinkedList object with another LinkedList object, one after another. The class itself is harder to understand, so are the functions. Adding or deleting an item from the LinkedList isn't so hard to figure out because it simply involves assignment of the attributes to the new values. I found the 'reverse' function very confusing. I couldn't even manage to trace that function. It starts to get more and more confusing with recursion and things like 'self.nxt' or 'self.nxt.nxt'. Also, there are two different ways of building a LinkedList. One is that an item points to another LinkedList with all the remaining items. The other one is an item points to another one (and another and another....) so that we need a 'node' class. Overall, this class seems a lot more complicated than the ones we did before.
Moreover, I found this week's lab quite challenging for me. I have not fully understood how to manage linked list yet. The functions all require some recursion in them. It is not easy for me to figure out the recursion inside LinkedList. I had to spend time working on this lab again.
No comments:
Post a Comment