Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
579 views
in General by (108k points)
closed by

What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A → є and A → a) to parse a string with n tokens?


1. n/2
2. n – 1
3. 2n - 1
4. 2n

1 Answer

0 votes
by (101k points)
selected by
 
Best answer
Correct Answer - Option 2 : n – 1

Explanation:

Grammar with no epsilon- and unit-production

S → PQ

P → pp

Q → qq

Derive String: ppqq

S → PQ

S → ppQ

S → pppqq

String length = 4

Production needed = 4 – 1 = 3.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...