Well, A2 is officially over. I actually turned it in 2 hours early.
It definitely helped me understand recursion more than A1 did. Actually A1 didn't really help me at all, since I never got the recursive function to work well.
In the function is_regex, you have to recursively check a string to see if it passes as a regex or not. If it has a bar or a dot, you check that is_regex of the left side and is_regex of the right side return True. Since it's recursive, the function does all that for you, given that you have the right basecases.
I personally found regex_match to be the hardest. I had to read every single Piazza post pertaining to it and talk it out with a friend before I even vaguely understood what I had to do. Then it clicked, and the feeling I got when all the functions came together and worked is probably the reason why I'm still even in Computer Science.
No comments:
Post a Comment