Week 10
This week we finished assignment 2 part II. In the first 'is_regex' function, we have revised so many times since there are a lot of cases needed to be considered. It is also tightly related to the 'build_regex_tree' function. Their codes are quite similar to each other. As each regex type has very different form, it is difficult to put them together. The hardest part I found was to check long regex with parentheses, since it takes a long time to figure out how to separate BarRegex and DotRegex into two parts to check if each part is a regex.
I didn't expect myself to finish writing 'all_regex_permutations' so quickly. When I first read the instruction, I thought it was really hard to do it. But it turns out that it is quite a short function to write. I think it is probably because I've got better with recursion.
This week's lab is really tough. I understood the instruction and our TA helped us a lot and gave us some hint. However, we still didn't manage to find a way to write the function. I found it is especially challenging to do recursion on linked list node and binary tree node classes. I need much more practice on that.
No comments:
Post a Comment