Day 79 Data Structures & Algorithms
Day 79 is in the books. Today we started off the day with a little something our instructor likes to call “Mind Fun”. It’s a nice way to get our brains warmed up. Typically we’re given some sort of challenge that requires us to identify a mathematical pattern or computer science concept in order to solve it. We needed a few hints, but eventually with the help of our instructor and one of our classmates we all got it. One of the really cool things about this program is that we have people from all kinds of backgrounds so typically one of us will find the solution. That’s what happened today. One of my classmates cracked the code and then helped explain it to me. That kind of collaboration has been one of the best parts of the program.
After lunch half of the groups did a quick presentation on the algorithms that they chose to research. We covered Bubble Sort, Insertion Sort, and Merge Sort. It was a really great way to learn more about each of those algorithms. It’s really interesting to see the different ways that people have gone about solving this problem of sorting elements in an array. It’s really good to understand the different use cases for each one as well so that you can use them appropriately when the need arises.
During the last part of the day we were introduced to linked lists. A linked list is a type of data structure. Imagine if you had an object that was filled with other objects. The outer object will be our linked list in this example. Each of the inner objects is called a node, but they are just objects with certain types of properties. Each node stores a value and a pointer to the next node in the list. The first node in the list is referred to as the head because it’s the first item in the list. The last node in the list is referred to as the tail because it is the last item in the list. The outer object has a property called head which stores the value of the first node, and a property called tail which stores the value of the last node in the list. So we have a way to easily identify the first and last items in our list, but what about the items/nodes in between?
The only way that you can access the inner nodes is by working your way through the chain. It’s like playing a game of telephone. Let’s say you’re searching for the value of a specific node. You would have to check the first node in the list to see if it contains the value that you are looking for. If it does not then you would call next and go to the second item in the list. You would repeat this process until you find the value that you are looking for.
I’m really digging this computer science stuff. It’s definitely new territory for me and it’s stretching my brain in different ways, but I love that feeling of making my brain work hard. I know that it’s getting stronger each day and that is a cool feeling. That’s enough for today. I’m off to finish a job application before bed. Until next time…happy coding.
79 down 21 to go