cst 370: week 6

This week, we learned about AVL trees, 2-3 trees, heaps, heapsort, hashing, and rehashing.

An AVL tree is a balanced binary search tree where the height difference between left and right subtrees is at most one. A 2-3 tree keeps all leaves at the same level, with nodes containing one or two values.

A heap is a complete binary tree used in heapsort, where elements are organized as a max heap or min heap. In heapsort, a max heap is built first, then the largest elements are removed one by one to sort the data.

Hashing maps keys to table positions using a hash function. Collisions are managed through separate chaining using linked lists or linear probing by finding the next open slot. When the table becomes too full, rehashing increases its size to a larger prime number to maintain efficiency.

This week was a bit challenging for me, but it was manageable. I unfortunately waited until the last minute for doing the homework.

Comments

Popular Posts