Posts

Showing posts from August, 2025

CST370: wk 7

 This week we went over dynamic programming for collecting coins on a grid and Floyd’s algorithm for finding all-pairs shortest paths. The coin problem was pretty cool because it wasn’t just about getting the max coins, but also figuring out the exact path to take, and having to follow a weird tie-break rule where you pick left over top if they’re equal. Floyd’s algorithm made sense once I thought of it as letting more “stops” into the route one at a time and checking if that made a shorter path. I also got some practice handling -1 as infinity in the input/output. Overall, I feel like I’m getting more comfortable with DP grid problems and shortest path algorithms, and using Scanner in Java made the code way easier to read.

CST370: Wk 6 Trees, Heaps, and Hash

 So this week we covered AVL trees, max Heaps as well as hashing functions.   AVL trees are an interesting way to store data and to actively keep them balance and organized.  Heaps are useful to keep the highest value towards the top of the heap.   Hashing is interesting to myself in particular when it comes to dicts in python, since there is some kind of hashing function going on behind the scenes.