The Gateway to Computer Science Excellence
0 votes
130 views
In certain programming languages, comments appear between delimiters such as $\text{/#}$ and $\text{#/}.$ Let $C$ be the language of all valid delimited comment strings. A member of $C$ must begin with $\text{/#}$ and end with $\text{#/}$ but have no intervening $\text{#/}.$  For simplicity, assume that the alphabet for $C$ is $\text{Σ = \{a, b, /, # \}.}$
a. Give a $DFA$ that recognizes $C.$
b. Give a regular expression that generates $C.$
in Theory of Computation by Veteran (55k points) | 130 views

1 Answer

0 votes

Regular expression: /#(a + b + /+ #*a + #*b)*#/

by Active (5.1k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,645 questions
56,597 answers
195,837 comments
102,140 users