both in LL1

LL1 only checks FIRST of grammar and if there same alphabet or not.

LL1 only checks FIRST of grammar and if there same alphabet or not.

The Gateway to Computer Science Excellence

+3 votes

Best answer

$1)$ $FT(S)=\left \{ a,b,\epsilon \right \}$

$FL(S)=${ a,b,$}

NonTerminal | |||

a | b | $ | |

S | $S->aSbS$. , $S->\epsilon $ | $S->bSaS$. , $S->\epsilon $ | $S->\epsilon $ |

yes it is not $LL(1).$

$2)$ $FT(S)=\left \{ a \right \}$

$FT(A)=\left \{ c,\epsilon \right \}$

$FT(B)=\left \{ d,\epsilon \right \}$

$FL(S)=${$}

$FL(A)=${d,b}

$FL(B)=${b}

NonTerminal | |||||

a | b | c | d | $ | |

$S$ | $S->aABb$ | ||||

$A$ | $A\rightarrow \epsilon$ | $A\rightarrow c$ | $A\rightarrow \epsilon$ | ||

$B$ | $B\rightarrow \epsilon$ | $B->d$ |

It is $LL(1).$

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,651 questions

56,214 answers

194,173 comments

95,428 users