Saturday, February 27, 2016

Week 5 of algorithms part 1. Red Black Trees

The fifth week of my coursera algorithms course is done.

This was the most interesting week of study for me. We studied balanced binary search trees. I have read about red black trees trees before, but it never really clicked for me. However, the lecture did a great job explaining red black trees by first presenting the related 2-3 tree. This made understanding the red black tree much easier. I am very happy to know this material now.

The exercises were again helpful in pushing me to really understand red black trees. Can you identify if a node should be red or black? Can you make insertions into such a tree? It was a bit painful to write these trees out on paper and trace through the changes, but it's the best way to really show you know it. The exercises had some true/false questions as always, and I got tricked up on them as always. I feel like they are there just to trip you up a few times and make you repeat the exercises a few times before moving on.

This week's programming assignment was my favorite one so far. We actually implemented a KdTree. In some previous assignments we used existing data structures that were presented in class to do something. In this lecture, we were asked to implement the KdTree, which I thought was more interesting and instructive.

I just realized that this is the last programming assignment we will have. This upcoming week, we will have lectures on Hash tables, exercises and then the Final Exam. Hopefully, the exam pushes me to re-think all of the past material and review it so that it really gets engrained in my mind. I have to fight the instinct of trying to just get a good grade, and instead make my goal be getting a good working knowledge of these data structures and algorithms.

Hopefully, I meet that goal.

No comments:

Post a Comment