CST 370 Week 6

 

WELCOME TO WEEK 6

Learning Journal - CST 370

This week, we learned a lot of new material. However, the topics I found most interesting and fun to work on in the exercise problems were AVL and 2-3 Trees.

First, we started by learning about two types of balanced binary search trees: AVL Trees and 2-3 Trees. These balanced BSTs make search operations more efficient compared to unbalanced BSTs. For a BST to be classified as an AVL or 2-3 Tree, it must meet certain qualifications.

For example, an AVL Tree must have a balance factor of -1, 0, or 1 for each node. They can become unbalanced when an insertion or deletion occurs. We learned how to rebalance them by applying rotations, including right rotation (R rotation), left rotation (L rotation), left-right rotation (LR rotation), and right-left rotation (RL rotation).

For 2-3 Trees, the qualifications are as follows: each non-leaf node can have 2 or 3 children, each node can have 1 or 2 keys, and all leaves must be at the same level of the tree. Unlike AVL Trees, 2-3 Trees do not use rotations. Instead, they maintain balance through promotion and swapping.

I really enjoyed the material this week!

Comments

Popular posts from this blog

CST 370 Week 3

CST 311 Week 1

CST 370 Week 2