The week of Binary Search Trees, or BST for short. Well this is basically the Binary Trees that Danny showed us a few classes back with a small twist, where similar to the Binary Trees, there can only be a maximum of 2 children nodes per node. However, the right child node is always larger than the node's value and the left child node is always smaller than the node's value. The only tricky part for this week was the delete function in the BST code due to the many conditions that we have to check. But as Danny said, writing down the steps and illustrations definitely make it a lot simpler to implement the body. Here's the function I was talking about:
As you can see his notes really helps make sense of everything and makes implementing it a breeze.
On a side note, Test 2 was this week and it went really well which is really good news. I hope everyone did as well too. Let's just hope that the final would go as well as this!

No comments:
Post a Comment