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.6k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,833 questions

57,689 answers

199,290 comments

107,279 users