Given a regular expression over some alphabet (say a-z), generate all the strings it describes, in order, shortest first, collating sequence within equal lengths. For example, generate
""
"a"
"b"
"aa"
"ab"
"ba"
"bb"
"aaa"
etc.

for (a|b)*

Pick your implementation language carefully. Maybe wait until more languages are presented in this course.

Don't peek unless you are done working on the problem!

































Answer by McKeeman

See ~mckeeman/src/m/wg23/wg23.m

Answer by McIlroy

See www.cs.dartmouth.edu/~doug/nfa.ps