The shown finite state machine is used to check if an input data stream matches with some regular expression. The data matches the regular expression if the final state qd is reached at the end of the input stream. What regualar expression(s) will be checked by the state machine? You may select one or more answers.
- ^([f|s|g]+(fs|gss|fs))*(fgg|s|gs[gg|s]*)$
- ^((g(ss|ff|g))|fs)*(s|((f|gs)?gg))$Correct
- ^((g?(ss|g))|fs)+(s|gsgg|gg)$
- ^(gff|gss|ff|sf)*(fgg|gsgg|s|gg)$
Official answer
^((g(ss|ff|g))|fs)*(s|((f|gs)?gg))$
Departments
Not tagged yet.
Occurrences
- FSG 2021 · ev · quiz 8