I personally think binary search trees are pretty darn neat.
Binary search trees are binary trees in which the left subtree of a node only contains values less than that of the node, while the right subtree contains values that are greater. I'm sure there are lots of ways this is a useful and efficient way to store information, but I think it's beyond me at the hour of 12:17am to come up with a practical application. Mostly, it's a great way to store a whole bunch of sorted keys, and you need to be able to easily locate the highest and lowest stored value or something.
I take back everything I said about this being a hard computer science week. I believe the entire exercise took me a grand total of ten minutes. I'm finally at home in an area where recursion is forbidden. I just need to donate several hours of my tomorrow and Friday to assignment 2, and I will proceed to enjoy a relaxing weekend of having to work on other stuff. (This is assuming I do not procrastinate on assignment 2. I am currently taking a very optimistic viewpoint.)
Tree structures are just becoming more and more comfortable for me as we continue to move forward. I shall eagerly await the results the automarker will provide me with on exercise 6, so I can find out if the towering ten minutes spent coding was time well spent. That was also the last exercise to complete for the term (I think?)! From now on, the remainder of my Friday afternoons will be blessed and free!
No comments:
Post a Comment