Friday, February 28, 2025

CST370 - Week 7

 Studying for the final this week went smoother than expected. My biggest concern was getting a grasp on AVL and 2-3 trees. For whatever reason, constructing these trees just wasn't clicking for me, but after working through some practice problems, I'm feeling more comfortable with the material. The last module introduced Djikstra's algorithm, which determines the shortest path from a single source vertex to each of the other vertices. This algorithm is widely known and used for GPS, internet routing, etc. My favorite algorithm from the last two modules is probably Prim's algorithm. Something about finding the minimum spanning tree was just really fun for me to work through.

Tuesday, February 18, 2025

CST370 - Week 6

 For this week, we went over what makes an AVL tree, 2-3 trees, and heaps. Luckily most of this was familiar to me from my data structures class, as my biggest challenge this week was finding time to work on homework due to a busy holiday weekend at my job. Part 1 of the coding assignment had to do with "heapifying" a data set to maintain a max heap, or a heap where every parent is larger than both its children. The second part of this week's module had to do with hashing and how to handle collisions. We went over two strategies for handling collisions - "separate chaining" and "linear probing". For the coding assignment, we wrote a program that would take in user commands (for example, "insert 20") and hash/rehash the map as necessary. In the instance of a collision, it will simulate the steps of linear probing. I had a lot of fun with this assignment actually, even though I had to finish it in quite a rush. It was a good review of unordered_maps in C++ and I got a much more thorough understanding of how a rehashing works.

Tuesday, February 11, 2025

CST370 - Week 5

 This week we spent time covering tree traversals, the quicksort algorithm and topological ordering. When I first read up on Khan's algorithm, I expected it to be harder to understand, but I was glad to realize it was quick to pick up. The challenge for me came when writing the code to implement topological ordering. I had no problem with the basic implementation, but I had trouble when the input data contained two source nodes. I was eventually able to figure out my mistake and got the code working. Another challenge for me was the last question of the quiz that involved the King's puzzle. I realized that my ability to recognize a pattern and turn it into a mathematical formula was a little rusty. This is definitely something I should brush up on before the final exam.

Tuesday, February 4, 2025

CST370 - Week 4

 This week I spent the majority of time studying for the midterm. My main concern was finding and analyzing the recursive relation of certain algorithms, but I managed to do any and all practice problems and something finally clicked for me regarding that topic and it makes much more sense than it did originally.

Week 4 introduced the merge sort algorithm. While it can seem complicated at first it really is just one use of the divide and conquer strategy, where we break down the problem into smaller parts and then solve the more manageable parts before merging the pieces back together.