int max(int i, int j)
/* return maximum of integers i and j */
{
return i > j ? i : j;
}
2. Describe the languages denoted by the following regular expressions:
- 0(0|1)*0
- ((epsilon|0)1*)*
- (0|1)*0(0|1)(0|1)
- 0*10*10*10*
- All strings of letters that contain the five vowels in order.
- All strings of letters in which the letters are in ascendinglexicographical order.
- Comments consisting of a string surrounded by /* and */ without anintervening */ unless it appears inside the quotes " and ".
- (nerk | bob)(s | sled)
- a(ab) * | E
- (f | E)(i | E)(s | E)(h | E)
6. Write a regular expression giving all strings of a's and b's with exactly two a's.
No comments:
Post a Comment