CST 370 - Design and Analysis of Algorithms - Week 6
This week in CST-370, we learned about more advanced data structures such as AVL trees, heaps, and hashing. AVL trees solve the issue of unbalanced binary search trees by maintaining a balance factor between -1 and 1, ensuring logarithmic time complexity for operations like search, insert, and delete. I learned how rotations (left, right, and combinations of both) restore balance when inserting or deleting nodes. The concept of balancing height was interesting because it talks about the trade-offs between complexity and performance.
We also learned about heaps, focusing on their role as priority queues. A heap is a complete binary tree where each parent node adheres to a specific order property, either greater than (max-heap) or less than (min-heap) its children. I learned the importance of heapify operations and how heaps support efficient insertion and deletion in logarithmic time. Also, heapsort was introduced as a sorting algorithm that leverages the heap’s structure to achieve O(n log n) time complexity. Lastly, the discussion on hashing and collision resolution methods, such as linear probing and separate chaining, provided a clear understanding of how hash tables manage key-value mappings efficiently.
Comments
Post a Comment