This week has been a lot about trees. Obviously I mean binary trees not wooden ones. We've been traversing them, picking them apart, and building them back up. As much as I've heard about binary trees before, I've never actually gotten around to seriously working with them. As much as I dislike python syntax, I have to admit that working with trees is much easier in python than the other languages I'm used to.
I'm writing this blog a bit later than I should be (tuesday as opposed to last friday) but at the same time I want to take this opportunity to talk about the new assignment (and exercise). Regular expressions are quite an invaluable tool, and I'm really looking forward to learning about them, even at the simplified level we are provided with. I'm currently working on a personal project, a component of which is document traversal and indexing, and I think regular expressions are just what I need.
Regular expressions are not exactly intuitive however. With expressions like
^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$ readability is obviously a concern (looks like what they use to censor swearing in cartoons), but I'm guessing its just a matter of getting used to.
As for exercise 5 - it seems pretty straight forward. Part A is obviously significantly easier requiring a simple traversal of the tree and passing along an integer. As for Part B, it seems like I could use a similar recursive traversal as Part A but store the roots separately. I really haven't given all that much thought to it yet, but it does at least seem easier than E4.
Well, that concludes my slog for today (pun intended), thank you for reading it!
P.S. I'm looking for a better name for this blog, suggestions appreciated!
No comments:
Post a Comment