Day fourty-four
Data Structures and Algorithms
This weekend I finished the final assignments for the Data Structures and Algorithms course. They were a real challenge this week, but, to be honest, they were a challenge every week. I’ve never liked maths and I don’t have a brain for numbers. It’s not that I don’t think logically, I think I do, it’s more the actual numbers that I don’t get on with.
My old latin teacher once told me that translating a sentence from latin to english was just like a quadratic equation. I kind of saw what he meant, but I loved latin and hated maths so I didn’t quite believe him, but my latin teacher also taught me two other things that I continue to use today.
Caesar was one of my least favourite authors. One of the key features of a latin sentence is that you will only ever have one main verb. All other verbs will be verb constructs of some kind or another, but never a true main verb. Caeser had a habit of writing sentences that were over 50 lines long, which made finding the main verb, its subject and its object a real challenge. This made translation hard, but it also taught me that every problem, no matter how big, could be solved by breaking it up into smaller parts. If you can find that main verb amongst the hundreds of other words, and you could find that verb’s subject and object and any adjectives or adverbs agreeing with those three key features, you’ve not only already solved part of your problem, but you have the backbone of the sentence which will make the rest of the translation a whole lot easier. In programming, this has been infintely useful. Some problems are so big, you can’t even identify the source or key feature of them, but by breaking the problem up, solving it incrementally, an impossible problem becomes possible.
I feel that everyone who has studied another language has, at least once, said “this doesn’t make sense”. I have many, many, many times. Faced with a long, rambling sentence it’s pretty easy to suddenly realise that it’s not making sense. There were so many times when I would simply look at my latin teacher and insist that it didn’t make sense. He had a favourite response: “It’s not that it doesn’t make sense, it’s that you aren’t making sense of it.” It doesn’t matter how well something is going, if you get into a situation where it all stops making sense, you have to look at your approach and if it is wrong, correcting it can be as simple as trying it another way.
I think that both of these lessons have served me well so far, but this is not a blog post about latin or my latin teacher. It is about what I learnt on the Data Structures and Algorithms course. I’m not going to go into the detail of all the different data structures I’ve learnt about or the algorithms that go with them here. I would like to in the future so that I can cement what I’ve learnt, but here I just want to reflect on what I’ve learnt, and what has changed for me by doing the course.
But these two pieces of advise were of great value throughout the course. There were concepts I struggled with, problems that I found incredibly hard to solve, and I think the reason that I completed the it was because I was able to divide those problems into smaller pieces, and tackle them one element at a time. I didn’t get frustrated when I didn’t understand, I just tried a different approach.
When I first found out I was going to do the course, I was instantly convinced I wouldn’t be able to do it. Algorithms seemed like a big scary word relating to computer scientists and mathmaticians. I’d say one of the best things about the doing it for me was simply that I could finish it. It took me a while to grasp some of the concepts, and it took me much longer than the 3 hours the course estimated for the assignments, but I did it. I feel a huge sense of accomplishment, and also feel like that I’ve started to explore a whole different side of programming that I’d almost assumed was off limits to my non-mathmatical, non-computer-science-degree brain.
I think it also changed how I think about the methods I use. The course went through a few data structures and identified the algorithms that came with them. Things like finding, inserting and deleting; basic methods that I’d never really thought about. The innate methods of objects were something under the hood, that I didn’t have to concern myself with. Now I know what’s going on, and can reason about how to implement these kinds of methods myself.
I think I’ve written before how, before I started at 8th light, I wasn’t concerned that much with efficiency, but after so many hours of learning about Big O Notation and seeing how you can affect the efficiency of an algorithm, this is something I constantly thinking about. When I was playing with streams, one of my first thoughts was whether they were faster than loops. I never would have considered this before.
I had thought that most of what I was learning was slightly too abstract to really affect how I write code, but it wasn’t. The more I understood about the data structures, the more I considered what to use, how my program was working, and how to use the language tools that were available to me.
What the course really instilled in me most though was just the feeling that there is still so much to learn, and that I can learn it.