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.2k
- Engineering Mathematics 4.7k
- Digital Logic 1.9k
- Programming & DS 3.5k
- Algorithms 3k
- Theory of Computation 3.7k
- Compiler Design 1.5k
- Databases 2.8k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 837
- Others 1.2k
- Admissions 284
- Exam Queries 398
- Tier 1 Placement Questions 17
- Job Queries 51
- Projects 7

33,712 questions

40,256 answers

114,368 comments

38,885 users