Tutorial Week 2 (Solutions) |
Task 1. Here are the corresponding regular expressions.
Task 2. None of these languages can be formalised by regular expressions. The problem is that regular expressions can't count and don't allow us to express stack-like behaviour. Task 3. A plausible implementation is here. Many other implementations are possible. |