.....

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

0 votes

+3 votes

Best answer

S` - > .S, dollar

S - > .Aa, dollar [Because of .S] ---------------------1

A - > .Ab, a [Because of A at 1, and lookahead symbol will be first ( a, dollar) i.e a] ------ 2

A - > .c, a [Because of A at 1, and lookahead symbol will be first ( a, dollar ) i.e a]

A -> .Ab,b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]

A -> .c, b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]

So we can also write it as

S` -> .S, dollar

S -> .Aa, dollar

A - > .Ab, a/b

A - > .c, a/b

Option c is correct here

S - > .Aa, dollar [Because of .S] ---------------------1

A - > .Ab, a [Because of A at 1, and lookahead symbol will be first ( a, dollar) i.e a] ------ 2

A - > .c, a [Because of A at 1, and lookahead symbol will be first ( a, dollar ) i.e a]

A -> .Ab,b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]

A -> .c, b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]

So we can also write it as

S` -> .S, dollar

S -> .Aa, dollar

A - > .Ab, a/b

A - > .c, a/b

Option c is correct here

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.2k
- Digital Logic 2k
- Programming & DS 3.7k
- Algorithms 3.2k
- Theory of Computation 4k
- Compiler Design 1.6k
- Databases 3k
- CO & Architecture 2.6k
- Computer Networks 3k
- Non GATE 1k
- Others 1.3k
- Admissions 486
- Exam Queries 435
- Tier 1 Placement Questions 18
- Job Queries 56
- Projects 9

36,161 questions

43,619 answers

124,002 comments

42,879 users