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.

No comments:

Post a Comment