Posts

CST370 Week 7

     This week I went over Counting Sort and Radix Sort, which skip the usual comparisons and can be really fast for certain kinds of numbers. I learned how dynamic programming can make some divide and conquer algorithms more efficient, like in the coin collection and coin row problems. We also covered Warshall’s and Floyd’s algorithms for finding transitive closures and all-pairs shortest paths, and how they connect to dynamic programming. On top of that, we looked at the greedy method with Prim’s algorithm for finding a minimum spanning tree. I kept up my habit of drawing everything out step by step, and seeing it on paper made each algorithm way easier to follow and understand.

CST370 Week 6

     This week we covered AVL trees, heaps, and hash tables. I felt like I had a solid grasp on hash tables, but AVLs and heaps were a bit tougher without a visual. The AVL visualization site that was shared really helped me understand how the rotations work. I also found that writing the problems out on scratch paper helped a lot. I could walk through the rotations step by step and then use the site to double check. For heaps, I found it much easier to understand the structure when it was drawn out as a tree instead of just looking at the array. I want to get better at working directly with the array, but right now, seeing it as a tree helps everything click into place faster

CST370 Week 5

     This week we went over Kahn’s algorithm, Quick Sort, and how to traverse a BST. I struggled a bit on my first read-through, but going step by step and writing things out helped a lot. Following the pointers in Quick Sort and tracking each step made it easier to understand. For Kahn’s algorithm, building the in degree table and manually popping nodes off my paper queue helped me visualize the process and work through it more clearly. Breaking things into smaller chunks made the material feel a lot more manageable.

CST370 Week 4

     This week I mostly focused on studying for the midterm. I reviewed the lecture slides, redid some of the homework problems, and practiced topics like BFS, DFS, recurrence relations, and time complexity. Putting together the cheat sheet was super helpful. It made me really think through what we have covered and helped me remember things I had forgotten. Writing everything out in my own words made a big difference. I also spent time practicing the logic puzzles. Starting with smaller input sizes instead of trying to jump straight to the full solution made those problems a lot easier to approach.

CST370 Week 3

 This week we went over BFS and DFS algorithms. We covered how BFS uses a FIFO queue, while DFS uses LIFO stacks. The first homework focused on DFS and used recursion to take advantage of the implicit stack. Our second assignment was on the Traveling Salesman Problem, using brute force to try all possible paths. Since the input could have up to 15 cities, the program had to generate and check every permutation, which really showed how quickly brute force becomes inefficient.

CST370 Week 2

     I found the assignments this week to be a lot of fun. I really enjoy coding challenges that feel like brain teasers. As for the material, recursion was definitely the trickiest part for me. I had to take my time with those questions on the quiz and did a bit of extra reading to get a better grasp on it. I’ve found that recursion makes a lot more sense when I see it in action through code, rather than trying to understand it in the abstract.

CST370 Week 1

 This week we worked on a palindrome puzzle. I immediately recognized it from when I solved a similar one on LeetCode a few years ago, though back then I used Python. My first instinct was to use a two pointer approach, but I specifically remembered this one because the optimal Python solution was a one liner: return string.lower() == reversed(string.lower()) I looked up the equivalent syntax in Java and gave that a try. Once I got that working, I added the logic to remove any non alphanumeric characters from the input and then ran the provided test cases to verify the results. Overall it was a really fun assignment.