The Gateway to Computer Science Excellence

+3 votes

Given the following two grammars :

$G_{1} : S \rightarrow AB | aaB$

$ A \rightarrow a | Aa$

$B \rightarrow b$

$G_{2} : S \rightarrow a S b S | b S a S | \lambda$

Which statement is correct ?

- $G_{1}$ is unambiguous and $G_{2}$ is unambiguous.
- $G_{1}$ is unambiguous and $G_{2}$ is ambiguous.
- $G_{1}$ is ambiguous and $G_{2}$ is unambiguous.
- $G_{1}$ is ambiguous and $G_{2}$ is ambiguous.

+3 votes

Best answer

52,345 questions

60,517 answers

201,939 comments

95,368 users