Saturday, 8 March 2014

Week 8: LinkedLists and such

Well CompSci isn't going as well as I would like it to. It isn't that I don't understand the material presented in class and when I read code, I understand it. I also understand the concepts presented to us, such as the way data structures such as trees and LinkedLists are set up and used. However, when it comes to actually writing code myself and thinking visually of these concepts, I am definitely struggling. Sometimes I chalk it up to "not being a CompSci person" but other times I feel as though I'm just not putting enough effort in. Either way, something's got to change before my grade dips any lower.

In lecture, we've learned about LinkedLists. These are data structures that are recursive in nature and seems to be quite similar to trees. I do not really understand the difference in the two ways to represent them though. The "wrapper approach" uses self.size as well as self.front, but I can't really see a benefit to this. Maybe I've missed something. If anyone wants to comment further explaining the difference between these two representation types, it would be appreciated.

LinkedLists have a head, which holds the data for the node, and a pointer to another node, the tail. Almost all functions we did with this type of structure was recursive, because LinkedLists are recursive on their own. From what I can tell, this is a useful datatype because it can grow in different ways and it can be as large as you want it to be.


Even though I am getting almost completely comfortable with recursion, sometimes I find it hard to think about how recursion would work when trying to write a function. I found a site that helped with practicing the basics of recursion to some more complicated examples. It is called CodeAcademy and it might come in handy for any fellow programmers-in-training.

That's all for now, except to say assignment 2 part 1 wasn't really all that bad. I was surprised at how much I could do.

No comments:

Post a Comment