Well, it's hard to believe we are already at the second last week of CSC148. I remember the first post on this SLOG as if it was yesterday...
The majority of my week 10 was spent on the second part of assignment 2 and, overall, I felt it was a very useful assignment to have done. I felt like I had both solidified my skills with writing recursive functions as well as my understanding of tree abstract data types. After all, the special regex trees we were working with were basically just binary trees with a bunch of added restrictions.
All four of the functions (and in my case, an added helper function) covered one aspect of regex tree ADT: building them, breaking them back down, and checking their validity. Of course, not every part of the assignment explicitly had us working with the regex tree ADT, but a big part of the assignment forced us to view a regex expression string like '(1.0)*' as a tree-type data structure in itself.
I felt the biggest challenge with the assignment was the regex_match function in particular. Not because it was particularly difficult to write, but more so because it had so many different "moving parts". This is the first big function in CSC148 that I've had to write that I felt it necessary to test over and over again to see if I had every little outlier case working...and with good reason too! It was tedious but testing this function vigorously would, not often but every little while, produce some kind of tiny error in the "moving parts" that had to be tweaked. Working on this function gave me a really good first hand look at the importance of testing to writing code.
Another thing that's been floating around in my mind, and not just because it has to be due to test 2, are LinkedLists. They are seemingly simple at first glance, and appropriately so, since they are much simpler that trees in terms of their structure, but implementing them with other ADTs has been a little bit of a hassle in the tutorials so far. So for the next week, LinkedLists will be a big priority for me.
Hope you enjoyed this post!
No comments:
Post a Comment